import java.util.Scanner; public class No604 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long A = sc.nextLong(); long B = sc.nextLong(); long C = sc.nextLong(); long k,K,sum; for(k = 0;(A+B-1) * k < C;k++) { } k -= 1; sum = (A+B-1) * k; if(C - sum <= A - 1) { K = C - sum; }else { K = A; } System.out.println(k * A + K); } }