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



if a == 0:

  print((0))

else:

  c = n % (a+b)  

  d = min(c, a)



  print(( int(n / (a+b)) * a + d ))
import sys

sys.setrecursionlimit(10 ** 6)

# input = sys.stdin.readline    ####

int1 = lambda x: int(x) - 1

def II(): return int(eval(input()))



def MI(): return list(map(int, input().split()))

def MI1(): return list(map(int1, input().split()))



def LI(): return list(map(int, input().split()))

def LI1(): return list(map(int1, input().split()))

def LLI(rows_number): return [LI() for _ in range(rows_number)]



INF = float('inf')



def solve():

    n, a, b = MI()



    ao = n // (a + b)

    r = n % (a + b)

    print((a * ao + min(r, a)))





if __name__ == '__main__':

    solve()

n, a, b = list(map(int, input().split()))
if a == 0:
    print((0))
else:
    c = n % (a + b)
    d = min(c, a)
    print((int(n / (a + b)) * a + d))

import sys

sys.setrecursionlimit(10**6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1


def II():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def MI1():
    return list(map(int1, input().split()))


def LI():
    return list(map(int, input().split()))


def LI1():
    return list(map(int1, input().split()))


def LLI(rows_number):
    return [LI() for _ in range(rows_number)]


INF = float("inf")


def solve():
    n, a, b = MI()
    ao = n // (a + b)
    r = n % (a + b)
    print((a * ao + min(r, a)))


if __name__ == "__main__":
    solve()

-n, a, b = list(map(int, input().split())) -if a == 0: -    print((0)) -else: -    c = n % (a + b) -    d = min(c, a) -    print((int(n / (a + b)) * a + d)) +import sys + +sys.setrecursionlimit(10**6) +# input = sys.stdin.readline    #### +int1 = lambda x: int(x) - 1 + + +def II(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def MI1(): +    return list(map(int1, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def LI1(): +    return list(map(int1, input().split())) + + +def LLI(rows_number): +    return [LI() for _ in range(rows_number)] + + +INF = float("inf") + + +def solve(): +    n, a, b = MI() +    ao = n // (a + b) +    r = n % (a + b) +    print((a * ao + min(r, a))) + + +if __name__ == "__main__": +    solve()