import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import log,gcd

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

A,B = mi()
N = int(input())

res = float("inf")

if N==1:
    exit(print(0))

def cond(a,b):
    t = [b//a] * a
    for i in range(b%a):
        t[i] += 1
    check = 1
    for v in t:
        check *= v+1
        check = min(check,N)
    return N <= check



for a in range(1,40):
    ok = 10**9
    ng = a-1
    while ok-ng>1:
        mid = (ok+ng)//2
        if cond(a,mid):
            ok = mid
        else:
            ng = mid
    res = min(res,a*A+ok*B)

print(res)