li = list(map(int,input().split()))

out = int(li[0] / (li[1] + li[2])) * li[1]

remain = li[0] - int(li[0] / (li[1] + li[2])) *  (li[1] + li[2])

if(remain > li[1]):

    out += li[1]

else:

    out += remain

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

n = int(N / (A + B))

m = min(N - n * (A + B), A)

print((n * A + m))
li = list(map(int, input().split()))
out = int(li[0] / (li[1] + li[2])) * li[1]
remain = li[0] - int(li[0] / (li[1] + li[2])) * (li[1] + li[2])
if remain > li[1]:
    out += li[1]
else:
    out += remain
print(out)

N, A, B = list(map(int, input().split()))
n = int(N / (A + B))
m = min(N - n * (A + B), A)
print((n * A + m))

-li = list(map(int, input().split())) -out = int(li[0] / (li[1] + li[2])) * li[1] -remain = li[0] - int(li[0] / (li[1] + li[2])) * (li[1] + li[2]) -if remain > li[1]: -    out += li[1] -else: -    out += remain -print(out) +N, A, B = list(map(int, input().split())) +n = int(N / (A + B)) +m = min(N - n * (A + B), A) +print((n * A + m))