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



res = 0

if N >= (A + B) * pow(10, 100):

  print((A * pow(10, 100)))

else:

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

  if N % (A + B) >= A:

    tmp2 = A

  else:

    tmp2 = N % (A + B)



print((tmp1 + tmp2))
N, A, B = list(map(int, input().split()))



res = 0

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

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

print(res)
N, A, B = list(map(int, input().split()))
res = 0
if N >= (A + B) * pow(10, 100):
    print((A * pow(10, 100)))
else:
    tmp1 = N // (A + B) * A
    if N % (A + B) >= A:
        tmp2 = A
    else:
        tmp2 = N % (A + B)
print((tmp1 + tmp2))

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

-if N >= (A + B) * pow(10, 100): -    print((A * pow(10, 100))) -else: -    tmp1 = N // (A + B) * A -    if N % (A + B) >= A: -        tmp2 = A -    else: -        tmp2 = N % (A + B) -print((tmp1 + tmp2)) +res += N // (A + B) * A +res += min(N % (A + B), A) +print(res)