def main():

    import numpy as numpy

    import sys

    n,a,b=list(map(int,sys.stdin.readline().split()))

 

    print((a*(n//(a+b))+min(a,n%(a+b))))

 

 

 

main()
def main():

    n,a,b = list(map(int,input().split()))

    x = (n // (a + b) ) * a 

    y = n % (a + b)

    ans = x + min(y,a)

    print(ans)

main()
def main():
    import numpy as numpy
    import sys

    n, a, b = list(map(int, sys.stdin.readline().split()))
    print((a * (n // (a + b)) + min(a, n % (a + b))))


main()

def main():
    n, a, b = list(map(int, input().split()))
    x = (n // (a + b)) * a
    y = n % (a + b)
    ans = x + min(y, a)
    print(ans)


main()

-    import numpy as numpy -    import sys - -    n, a, b = list(map(int, sys.stdin.readline().split())) -    print((a * (n // (a + b)) + min(a, n % (a + b)))) +    n, a, b = list(map(int, input().split())) +    x = (n // (a + b)) * a +    y = n % (a + b) +    ans = x + min(y, a) +    print(ans)