There is a rectangular grid of size $n \times m$. Each cell has a number written on it; the number on the cell ($i, j$) is $a_{i, j}$. Your task is to calculate the number of paths from the upper-left cell ($1, 1$) to the bottom-right cell ($n, m$) meeting the following constraints:
 -  You can move to the right or to the bottom only. Formally, from the cell ($i, j$) you may move to the cell ($i, j + 1$) or to the cell ($i + 1, j$). The target cell can't be outside of the grid. -  The xor of all the numbers on the path from the cell ($1, 1$) to the cell ($n, m$) must be equal to $k$ (xor operation is the bitwise exclusive OR, it is represented as '^' in Java or C++ and "xor" in Pascal). 
Find the number of such paths in the given grid.
The first line of the input contains three integers $n$, $m$ and $k$ ($1 \le n, m \le 20$, $0 \le k \le 10^{18}$) — the height and the width of the grid, and the number $k$.

The next $n$ lines contain $m$ integers each, the $j$-th element in the $i$-th line is $a_{i, j}$ ($0 \le a_{i, j} \le 10^{18}$).
3 3 11
2 1 5
7 10 0
12 6 4
3
3 4 2
1 3 3 3
0 3 3 2
3 0 1 1
5
3 4 1000000000000000000
1 3 3 3
0 3 3 2
3 0 1 1
0
1 1 1000000000000000000
1000000000000000000
1
1 1 1000000000000000000
999999999999999999
0
1 1 1
1
1
1 2 3
1 2
1
1 10 1023
1 2 4 8 16 32 64 128 256 512
1
1 20 1048575
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288
1
2 1 3
1
2
1
2 2 7
1 2
2 4
2
2 10 2047
1 2 4 8 16 32 64 128 256 512
2 4 8 16 32 64 128 256 512 1024
10
2 20 2097151
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576
20
10 1 1023
1
2
4
8
16
32
64
128
256
512
1
10 2 2047
1 2
2 4
4 8
8 16
16 32
32 64
64 128
128 256
256 512
512 1024
10
10 10 524287
1 2 4 8 16 32 64 128 256 512
2 4 8 16 32 64 128 256 512 1024
4 8 16 32 64 128 256 512 1024 2048
8 16 32 64 128 256 512 1024 2048 4096
16 32 64 128 256 512 1024 2048 4096 8192
32 64 128 256 512 1024 2048 4096 8192 16384
64 128 256 512 1024 2048 4096 8192 16384 32768
128 256 512 1024 2048 4096 8192 16384 32768 65536
256 512 1024 2048 4096 8192 16384 32768 65536 131072
512 1024 2048 4096 8192 16384 32768 65536 131072 262144
48620
20 1 1048575
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1
20 2 2097151
1 2
2 4
4 8
8 16
16 32
32 64
64 128
128 256
256 512
512 1024
1024 2048
2048 4096
4096 8192
8192 16384
16384 32768
32768 65536
65536 131072
131072 262144
262144 524288
524288 1048576
20
1 1 982347923479
1
0
1 2 1
1 1
0
n,m,k = map(int,input().split())
mat  = []
for _ in range(n):
    arr = list(map(int,input().split()))
    mat.append(arr)
from collections import defaultdict
memo = defaultdict(lambda:0)
def forw(i,j,cnt,val):
    val = val^mat[i][j]
    if cnt == half:
        memo[i,j,val]+=1
        return
    if i+1<n:
        forw(i+1,j,cnt+1,val)
    if j+1<m:
        forw(i,j+1,cnt+1,val)

def back(i,j,val,cnt):
    
    if cnt == ohalf:
        ans[0]+=memo[i,j,val^k]
        return
    if i-1>=0:
        back(i-1,j,val^mat[i][j],cnt+1)
    if j-1>=0:
        back(i,j-1,val^mat[i][j],cnt+1)
    


ans =[0]

total= n+m-2
half = total//2
ohalf = total-half

forw(0,0,0,0)

back(n-1,m-1,0,0)
print(ans[0])

