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

x=n//(a+b)

y=n%(a+b)

print((a*x+min(y,a)))

# if a==0:

#     print(0)

# else:

    # x=n//(a+b)

    # y=n%(a+b)

    # print(a*x+min(y,a))
n,a,b=list(map(int,input().split()))

# x=n//(a+b)

# y=n%(a+b)

# print(a*x+min(y,a))

if a==0:

    print((0))

else:

    x=n//(a+b)

    y=n%(a+b)

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

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

-x = n // (a + b) -y = n % (a + b) -print((a * x + min(y, a))) -# if a==0: -#     print(0) -# else: +if a == 0: +    print((0)) +else: +    x = n // (a + b) +    y = n % (a + b) +    print((a * x + min(y, a)))