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



div, mod = divmod(N, A + B)

ans = A * div

ans += min(mod, A)



print(ans)

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



d, m = divmod(N, A + B)

ans = A * d + min(m, A)

print(ans)
N, A, B = list(map(int, input().split()))
div, mod = divmod(N, A + B)
ans = A * div
ans += min(mod, A)
print(ans)

N, A, B = list(map(int, input().split()))
d, m = divmod(N, A + B)
ans = A * d + min(m, A)
print(ans)

-div, mod = divmod(N, A + B) -ans = A * div -ans += min(mod, A) +d, m = divmod(N, A + B) +ans = A * d + min(m, A)