#![allow(non_snake_case)] use std::io::{ self, prelude::* }; macro_rules! pick { ($tokens:expr) => { $tokens.next().unwrap().parse().expect("parse error") } } fn f(A: u64, B: u64, x: u64) -> u64 { let k = x/A; B*k + x-k } fn main() { let mut s = String::new(); io::stdin().read_to_string(&mut s).expect("i/o error"); let mut tokens = s.split_whitespace(); let A: u64 = pick!(tokens); let B: u64 = pick!(tokens); let C: u64 = pick!(tokens); let mut lo = 0; let mut hi = 1_000_000_000_000_000_000; while hi - lo > 1 { let mid = (lo+hi) / 2; if f(A,B,mid) < C { lo = mid; } else { hi = mid; } } let ans = hi; println!("{}", ans); }