a, b, t = map(int, input().split()) ans = 10**18 for y in range(min((t + b - 1) // b, a - 1) + 1): x = (t - b * y + a - 1) // a if x >= 0: ans = min(ans, a * x + b * y) print(ans)