n, a, b = list(map(int, input().split()))

amari = n % (a+b)

sho = n // (a+b)

if n <= a:

    print(n)

elif amari == 0:

    print((a*sho))

elif amari < a:

    print((a*sho + amari))

else:

    print((a*sho + a))

n, a, b = list(map(int, input().split()))

amari = n % (a + b)

sho = n // (a + b)

if n <= a:

    print(n)

else:

    print((a * sho + min(a, amari)))



n, a, b = list(map(int, input().split()))
amari = n % (a + b)
sho = n // (a + b)
if n <= a:
    print(n)
elif amari == 0:
    print((a * sho))
elif amari < a:
    print((a * sho + amari))
else:
    print((a * sho + a))

n, a, b = list(map(int, input().split()))
amari = n % (a + b)
sho = n // (a + b)
if n <= a:
    print(n)
else:
    print((a * sho + min(a, amari)))

-elif amari == 0: -    print((a * sho)) -elif amari < a: -    print((a * sho + amari)) -    print((a * sho + a)) +    print((a * sho + min(a, amari)))