def main(): from math import inf, ceil a, b = map(int, input().split()) n = int(input()) if n == 1: print(1) exit() ans = inf for i in range(1, n + 1): root = ceil(n ** (1 / i)) ok, ng = 0, i while ng - ok > 1: mid = (ok + ng) // 2 if (root - 1) ** mid * root ** (i - mid) >= n: ok = mid else: ng = mid ans = min(ans, (a + b * (root - 2)) * ok + (a + b * (root - 1)) * (i - ok)) if root == 2: break print(ans) if __name__ == '__main__': main()