def seachPrimeNum(N): if N == 1: return [] max = int(N**0.5) seachList = [i for i in range(2,N+1)] primeNum = [] while seachList[0] <= max: primeNum.append(seachList[0]) tmp = seachList[0] seachList = [i for i in seachList if i % tmp != 0] primeNum.extend(seachList) return primeNum N,L = map(int,input().split()) if L // (N-1) > 1: PL = seachPrimeNum(L//(N-1)) else: print(0) exit() ans = 0 for p in PL: ans += (L-p*(N-1)+1) print(ans)