import sys

input = sys.stdin.readline



N, A, B = [int(x) for x in input().split()]



AB = A + B



if AB == 0:

    print((0))

    sys.exit()



ans = A * (N // AB)

ans_mod = N % AB 



if ans_mod == 0:

    print(ans)

    sys.exit()



if ans_mod >= A:

    ans += A

elif ans_mod < A:

    ans += ans_mod



print(ans)
import sys

input = sys.stdin.readline



n, a, b = [int(x) for x in input().split()]



if a == 0:

    print((0))

    sys.exit()



if b == 0:

    print(n)

    sys.exit()



ab = a + b



n_ab = n // ab



ans = n_ab * a



remain = n - ab * n_ab



ans += min(a, remain)



print(ans)
import sys

input = sys.stdin.readline
N, A, B = [int(x) for x in input().split()]
AB = A + B
if AB == 0:
    print((0))
    sys.exit()
ans = A * (N // AB)
ans_mod = N % AB
if ans_mod == 0:
    print(ans)
    sys.exit()
if ans_mod >= A:
    ans += A
elif ans_mod < A:
    ans += ans_mod
print(ans)

import sys

input = sys.stdin.readline
n, a, b = [int(x) for x in input().split()]
if a == 0:
    print((0))
    sys.exit()
if b == 0:
    print(n)
    sys.exit()
ab = a + b
n_ab = n // ab
ans = n_ab * a
remain = n - ab * n_ab
ans += min(a, remain)
print(ans)

-N, A, B = [int(x) for x in input().split()] -AB = A + B -if AB == 0: +n, a, b = [int(x) for x in input().split()] +if a == 0: -ans = A * (N // AB) -ans_mod = N % AB -if ans_mod == 0: -    print(ans) +if b == 0: +    print(n) -if ans_mod >= A: -    ans += A -elif ans_mod < A: -    ans += ans_mod +ab = a + b +n_ab = n // ab +ans = n_ab * a +remain = n - ab * n_ab +ans += min(a, remain)