def func(N,K): numbers = [int(x) for x in range(1,N+1)] cnt = 0 for a in numbers.copy(): for b in numbers.copy(): for c in numbers.copy(): for d in numbers: if a*b+b*c+c*d+d*a == K: cnt +=1 return cnt if __name__ == "__main__": print(func(int(input()),int(input())))