A,B,K = map(int,input().split()) import math G = A // math.gcd(A, B) * B def is_ok(x): # x以下の数をK個以上作れたらOK return ((x // A) + (x // B) - (x // G)) >= K ok = 10 ** 18 + 1 ng = 0 while ok - ng > 1: mid = (ok + ng) // 2 if is_ok(mid): ok = mid else: ng = mid print(ok)