import sys

input = sys.stdin.readline



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

# print(N, A, B)



if A == 0:

    print((0))



elif N % (A + B) == 0:

    print((N // (A + B) * A))



else:

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

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

    print((count + rem))
from sys import stdin, setrecursionlimit

from collections import Counter, deque, defaultdict

from math import floor, ceil

from bisect import bisect_left

from itertools import combinations

setrecursionlimit(100000)



INF = int(1e10)

MOD = int(1e9 + 7)



def main():

    from builtins import int, map

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

    if A == 0:

        print((0))

        exit()



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

    if N % (A + B) > 0:

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

    print(ans)



if __name__ == '__main__':

    main()

import sys

input = sys.stdin.readline
N, A, B = list(map(int, input().split()))
# print(N, A, B)
if A == 0:
    print((0))
elif N % (A + B) == 0:
    print((N // (A + B) * A))
else:
    count = N // (A + B) * A
    rem = min(A, N % (A + B))
    print((count + rem))

from sys import stdin, setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations

setrecursionlimit(100000)
INF = int(1e10)
MOD = int(1e9 + 7)


def main():
    from builtins import int, map

    N, A, B = list(map(int, input().split()))
    if A == 0:
        print((0))
        exit()
    ans = (N // (A + B)) * A
    if N % (A + B) > 0:
        ans += min(N % (A + B), A)
    print(ans)


if __name__ == "__main__":
    main()

-import sys +from sys import stdin, setrecursionlimit +from collections import Counter, deque, defaultdict +from math import floor, ceil +from bisect import bisect_left +from itertools import combinations -input = sys.stdin.readline -N, A, B = list(map(int, input().split())) -# print(N, A, B) -if A == 0: -    print((0)) -elif N % (A + B) == 0: -    print((N // (A + B) * A)) -else: -    count = N // (A + B) * A -    rem = min(A, N % (A + B)) -    print((count + rem)) +setrecursionlimit(100000) +INF = int(1e10) +MOD = int(1e9 + 7) + + +def main(): +    from builtins import int, map + +    N, A, B = list(map(int, input().split())) +    if A == 0: +        print((0)) +        exit() +    ans = (N // (A + B)) * A +    if N % (A + B) > 0: +        ans += min(N % (A + B), A) +    print(ans) + + +if __name__ == "__main__": +    main()