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



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

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



print(ans)



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



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

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

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