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



cycles = n//(a+b)

count = 0

count += a*cycles

rest = n - (a+b)*cycles

if rest > a:

    count += a

else:

    count += rest

print(count)
N,A,B = list(map(int,input().split()))

ans = N//(A+B) * A

ans += min(A, N%(A+B))

print(ans)
n, a, b = list(map(int, input().split()))
cycles = n // (a + b)
count = 0
count += a * cycles
rest = n - (a + b) * cycles
if rest > a:
    count += a
else:
    count += rest
print(count)

N, A, B = list(map(int, input().split()))
ans = N // (A + B) * A
ans += min(A, N % (A + B))
print(ans)

-n, a, b = list(map(int, input().split())) -cycles = n // (a + b) -count = 0 -count += a * cycles -rest = n - (a + b) * cycles -if rest > a: -    count += a -else: -    count += rest -print(count) +N, A, B = list(map(int, input().split())) +ans = N // (A + B) * A +ans += min(A, N % (A + B)) +print(ans)