def main():

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



    ret = 0

    rep, rest = divmod(N, A + B)

    ret += rep * A

    ret += min(A, rest)



    print(ret)





if __name__ == '__main__':

    main()



# import sys

#

# sys.setrecursionlimit(10 ** 7)

#

# input = sys.stdin.readline

# rstrip()

# int(input())

# map(int, input().split())

def main():

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

    AB = A + B



    q, r = divmod(N, AB)

    print((A * q + min(r, A)))





if __name__ == '__main__':

    main()

def main():
    N, A, B = list(map(int, input().split()))
    ret = 0
    rep, rest = divmod(N, A + B)
    ret += rep * A
    ret += min(A, rest)
    print(ret)


if __name__ == "__main__":
    main()
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

def main():
    N, A, B = list(map(int, input().split()))
    AB = A + B
    q, r = divmod(N, AB)
    print((A * q + min(r, A)))


if __name__ == "__main__":
    main()

-    ret = 0 -    rep, rest = divmod(N, A + B) -    ret += rep * A -    ret += min(A, rest) -    print(ret) +    AB = A + B +    q, r = divmod(N, AB) +    print((A * q + min(r, A))) -# import sys -# -# sys.setrecursionlimit(10 ** 7) -# -# input = sys.stdin.readline -# rstrip() -# int(input()) -# map(int, input().split())