let a, b, n = Scanf.scanf "%f %f %f\n" @@ fun a b c -> a, b, c
let rec f x m =
  let nm = (floor (a*.x/.b)) -. a*.(floor(x/.b)) in
  if x < 0. then m
  else if nm >= m then f (x-.1.) nm
  else f (x-.1.) m
let () = print_int (int_of_float (f n 0.))