#n=int(input())

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

#l=list(map(int,input().split()))

#l=[list(map(int,input().split())) for i in range(n)]



v=n//(a+b)

ans=v*a

mod=n%(a+b)



temp=min(mod,a)

ans+=temp

print(ans)  
#k=int(input())

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

#hl=list(map(int,input().split()))

#l=[list(map(int,input().split())) for i in range(n)]

total=a+b

ans=(n//total)*a



print((ans+min(a,n%total)))



# n=int(input())
n, a, b = list(map(int, input().split()))
# l=list(map(int,input().split()))
# l=[list(map(int,input().split())) for i in range(n)]
v = n // (a + b)
ans = v * a
mod = n % (a + b)
temp = min(mod, a)
ans += temp
print(ans)

# k=int(input())
n, a, b = list(map(int, input().split()))
# hl=list(map(int,input().split()))
# l=[list(map(int,input().split())) for i in range(n)]
total = a + b
ans = (n // total) * a
print((ans + min(a, n % total)))

-# n=int(input()) +# k=int(input()) -# l=list(map(int,input().split())) +# hl=list(map(int,input().split())) -v = n // (a + b) -ans = v * a -mod = n % (a + b) -temp = min(mod, a) -ans += temp -print(ans) +total = a + b +ans = (n // total) * a +print((ans + min(a, n % total)))