#!/usr/bin/python3 n, c = [int(x) for x in input().split()] # cost[i][j] is the least cost you can guarantee when you've narrowed down the # true value to interval [i, j]. cost = [[10**9 for _ in range(n+1)] for _ in range(n+1)] # intervals of length 1 for i in range(n+1): cost[i][i] = i # any longer interval for l in range(1, n + 1): for i in range(n + 1 - l): for j in range(i, i + l + 1): worst_case = j if j > i: worst_case = max(worst_case, j + cost[i][j-1]) if j < i + l: worst_case = max(worst_case, c + cost[j+1][i+l]) cost[i][i + l] = min(cost[i][i+l], worst_case) print(cost[0][n])