a,b,k=map(int,input().split()) l,r=0,10**19 while r - l > 1: m = (l + r)//2 if m//a+m//b-m//(a*b)>=k: r=m else: l=m print(r)