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

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

rem=N%(A+B)

ans+=min(rem,A)

print(ans)

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



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

rem = N%(A + B)

ans+=min(rem,A)

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

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

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