(* O(t) *)
let solve a b t =
  let rec loop sum_a sum_b =
    if sum_a > t then
      sum_b
    else
      loop (sum_a + a) (sum_b + b)
  in
    loop a 0

let read_ints () = read_line () |> Str.split (Str.regexp " ") |> List.map int_of_string

let _ =
  match read_ints () with
  | [a; b; c] -> solve a b c |> string_of_int |> print_endline
  | _ -> ()