from math import gcd a, b, k = map(int, input().split()) lc = a * b // gcd(a, b) def cnt(x): return x // a + x // b - x // lc l = 1 r = a * k while r - l > 1: mid = (r + l) // 2 if cnt(mid) >= k: r = mid else: l = mid print(r)