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

ans = 0

tmp = N//(A+B)

ans += tmp*A

N -= (A+B)*tmp

ans += min(A,N)



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





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

b = N%(A+B)



print((a+min(A,b)))
N, A, B = list(map(int, input().split()))
ans = 0
tmp = N // (A + B)
ans += tmp * A
N -= (A + B) * tmp
ans += min(A, N)
print(ans)

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

-ans = 0 -tmp = N // (A + B) -ans += tmp * A -N -= (A + B) * tmp -ans += min(A, N) -print(ans) +a = N // (A + B) * A +b = N % (A + B) +print((a + min(A, b)))