import math a,b,k=map(int,input().split()) c=a*b/math.gcd(a,b) for x in range(a*b*k): if x//a+x//b-x//c>=k:break print(x)