A, B, C = map(int,input().split()) m1 = A + B - 1 s1 = C // m1 s2 = C % m1 if s2 < A: age = s1*A + s2 elif s2 >= A: age = (s1+1)*A print(age)