import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long A = scan.nextLong(); long B = scan.nextLong(); long C = scan.nextLong(); scan.close(); long t = C / (A + B - 1); //long ans = t * A + Math.min(A, C % (A + B - 1)); //System.out.println(ans); System.out.println(t * A + Math.min(C - t * (A + B - 1), A)); } }