The fight between Batman and Superman just got dirty. Superman tried to trick Batman and locked him inside an N x N grid. This gird is really special. It has values at each of its cell which is some positive integer.

Superman gave Batman a serious headache inside the grid. He gave him an integer K and ordered him to tell count of such K x K matrix which when summed equals a perfect cube. Only if Batman gives the correct answer will the grid open and let Batman out.

Batman being not so good at coding turns to you for help. Its time for you to prove that you are a real Batman Fan by helping him out.

Input:

The first line contains 2 integers N and K . This is followed up by an N x N matrix.

Output:

Print number of such K X K matrix whose sum is a perfect cube.

Constraints :

 N  ≤ 1000

 K  ≤ N

All values in matrix  ≤ 10^9

SAMPLE INPUT
3 2
5 69 2 
42 9 9 
5 8 1 

SAMPLE OUTPUT
3

Explanation

The 3:  2x2 matrices whose sum equals a perfect cube are:

(1,1) to (2,2)

(2,1) to (3,2)

(2,2) to (3,3)
n,k= map( int, raw_input().split() )

a = [ [] for i in range(n+1) ]

a[0] = [0 for i in range(n+1) ]
for i in range(1,n+1):
	a[i] = [0] + map( int,raw_input().split() )

for i in range(1,n+1):
	for j in range(1,n+1):
		a[i][j] = a[i][j] + a[i-1][j] + a[i][j-1] - a[i-1][j-1]

ans = 0

for i in range(k,n+1):
	for j in range(k,n+1):
		val = a[i][j] + a[i-k][j-k] - a[i][j-k] - a[i-k][j]
		cubeRoot = int( val ** (1.0/3) )
		if  cubeRoot**3 == val  or  (cubeRoot+1)**3 == val :
			ans += 1

print ans