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