import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigInteger; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); long a = Integer.parseInt(sa[0]); long b = Integer.parseInt(sa[1]); long k = Integer.parseInt(sa[2]); br.close(); long c = lcm(a, b); long ok = a * k; long ng = 0; while (Math.abs(ok - ng) > 1) { long mid = (ok + ng) / 2; long aa = mid / a; long bb = mid / b; long cc = mid / c; if (aa + bb - cc >= k) { ok = mid; } else { ng = mid; } } System.out.println(ok); } static long lcm(long a, long b) { BigInteger ba = BigInteger.valueOf(a); BigInteger bb = BigInteger.valueOf(b); return ba.multiply(bb).divide(ba.gcd(bb)).longValue(); } }