#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
  ll a, b;
  cin >> a >> b;
  ll n;
  cin >> n;
  if (n == 1) {
  	cout << "0\n";
  	return 0;
  }
  ll ans = 1LL << 61;
  for (ll i = 1; i <= n; ++i) {
    ll root = ceil(pow(n, 1.0 / i));
    ll ok = 0, ng = i;
    while (ng - ok > 1) {
      ll mid = (ok + ng) / 2;
      if (pow(root - 1, mid) * pow(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;
  }
  cout << ans << '\n';
}