program ksfloor
 implicit none
 integer(8) :: n,answer,i,a,b
 real(8),allocatable ::s(:)
 
 read*,a,b,n
 allocate(s(0:n))
 
 do i=0,n
  if(b==0) then 
    s(i)=0
  else
    s(i)=int(a*i/b)-a*int(i/b)
   end if
 end do

 answer=maxval(s)
 print*,answer

end program ksfloor
  