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

n = N//(A+B)

m = N%(A+B)

k = min(m,A)

print((n*A+k))
N,A,B = list(map(int,input().split()))

a = N//(A+B)

b = N%(A+B)

if b>A:

    print((a*A+A))

else:

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

N, A, B = list(map(int, input().split()))
a = N // (A + B)
b = N % (A + B)
if b > A:
    print((a * A + A))
else:
    print((a * A + b))

-n = N // (A + B) -m = N % (A + B) -k = min(m, A) -print((n * A + k)) +a = N // (A + B) +b = N % (A + B) +if b > A: +    print((a * A + A)) +else: +    print((a * A + b))