module countball
  sub Main(ByVal args() as String)
    dim arr(3) as string
    arr=Split(Console.ReadLine())
    dim a,b,c,n,x as long
 
    a=arr(0)
    b=arr(1)
    c=arr(2)

if b=0 then
Console.WriteLine(b)
Return
end if
 
if c=0 then
Console.WriteLine(a)
Return
end if
 
if a<=(b+c) then
      if a<b then
		Console.WriteLine(a)
        Return
      else
        Console.WriteLine(b)
        Return
      end if
end if

n=0
x=a/(b+c)
x=int(x)

n=n+(b*x)
a=a-(b*x)
a=a-(c*x)

while a>0
 
if a>=b then
a=a-b
n=n+b
elseif a>0 then
n=n+a
a=0
end if
 
if a>=c then
a=a-c
elseif a>0 then
a=0
end if
 
end while
 
Console.WriteLine(n)
 
end sub
end module