A,B,K = map(int,input().split()) def gcd(a,b): while True: r = a % b a = b b = r if r == 0:return a L = A * B // gcd(A,B) def f(x): return x // A + x // B - x // L end = A * K start = 0 while end - start > 1: mid = (end + start) // 2 if f(mid) >= K: end = mid else: start = mid print(end)