open Scanf
open Printf
open Num

let () =
  let a, b, x = scanf "%s %s %s\n" (fun x y z -> (num_of_string x, num_of_string y, num_of_string z)) in
  printf "%s\n" @@ string_of_num @@ quo_num b x -/ (quo_num a x) +/ (if mod_num a x =/ (num_of_int 0) then (num_of_int 1) else (num_of_int 0))

