a, b, c = map(int, input().split()) res = a + b - 1 q, r = divmod(c, res) if r <= a - 1: print(q * a + r) else: print((q + 1) * a)