A, B = map(int, input().split()) N = int(input()) ret: int = (A + B) * 30 if N == 1: ret = 0 for num_a in range(1, 31): ng, ok = 0, N - 1 while ok - ng > 1: c: int = (ok + ng) // 2 x, md = divmod(c, num_a) current = 1 for t in range(num_a): y = x + (t < md) current *= 1 + y if current >= N: break if current >= N: ok = c else: ng = c ret = min(ret, num_a * A + ok * B) print(ret)