a,b,k = map(int, input().split()) import math from functools import reduce def lcm_base(x, y): return (x * y) // math.gcd(x, y) l =lcm_base(a,b) def is_ok(x): t = x//a+x//b-x//l if t >= k: return True else: return False ng = 0 ok = a*k while ng+1 < ok: c = (ng+ok)//2 if is_ok(c): ok = c else: ng = c print(ok)