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

x = n // (a+b)

amari = n % (a+b)

if amari <= a:

    print((x*a+amari))

else:

    print((x*a+a))
n,a,b = list(map(int, input().split()))

s = n//(a+b)

rest = n%(a+b)

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

n, a, b = list(map(int, input().split()))
s = n // (a + b)
rest = n % (a + b)
print((s * a + min(a, rest)))

-x = n // (a + b) -amari = n % (a + b) -if amari <= a: -    print((x * a + amari)) -else: -    print((x * a + a)) +s = n // (a + b) +rest = n % (a + b) +print((s * a + min(a, rest)))