import math n = int(input()) C, V = map(int, input().split()) min_cost = float('inf') max_k = 20 # This can be adjusted based on problem constraints def compute_product(m, k, t, n): product = 1 for _ in range(t): product *= (m + 1) if product > n: return product for _ in range(k - t): product *= m if product > n: return product return product for k in range(1, max_k + 1): if 2 ** k >= n: current_sum = 2 * k cost = V * current_sum + k * (C - V) if cost < min_cost: min_cost = cost continue left, right = 2, n best_m = 1 while left <= right: mid = (left + right) // 2 product = 1 over = False for _ in range(k): product *= mid if product > n: over = True break if not over: best_m = mid left = mid + 1 else: right = mid - 1 m = best_m found = False for t in range(0, k + 1): product = compute_product(m, k, t, n) if product >= n: current_sum = m * (k - t) + (m + 1) * t cost = V * current_sum + k * (C - V) if cost < min_cost: min_cost = cost found = True break if not found: pass print(min_cost)