import java.util.*; import java.util.Arrays; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt(); int r =(a3-a2)/(a2-a1); int d = a2-r*a1; System.out.println(a3*r+d); } }