import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int k = sc.nextInt(); long lcm = getLCM(a, b); long left = 0; long right = Long.MAX_VALUE / 2; while (right - left > 1) { long m = (left + right) / 2; long count = m / a + m / b - m / lcm; if (count >= k) { right = m; } else { left = m; } } System.out.println(right); } static long getLCM(long a, long b) { return a / getGCD(a, b) * b; } static long getGCD(long a, long b) { if (a % b == 0) { return b; } else { return getGCD(b, a % b); } } }