n,m,k=gets.split.map{|e| e.to_i} d=n-1+m d2=(k/d)*d if k-d2==0 puts (k/d)*n else d3=k-d2 if d3<=n-1 puts (k/d)*n+d3 else puts (k/d)*n+n end end