import math a,b,k=map(int,input().split()) l=a*b//math.gcd(a,b) x=1 y=a*b*l while y-x>1: m=(x+y)//2 if m//a+m//b-m//l>=k:y=m else:x=m print(y)