import collections import sys sys.setrecursionlimit(10 ** 8) D = collections.defaultdict(int) ans = 0 def dfs(n,m,v): if D[m]>v+n-1: return global ans D[m]=v+n-1 n-=1 v+=m if n==0 or m==0: ans = max(v,ans) return if m==1: ans = max(v+n,ans) return dfs(n,-(-m//2),v) N,M = map(int, input().split()) for i in reversed(range(max(1,M-100),M+1)): dfs(N,M,0) print(ans)