#include <bits/stdc++.h>
using namespace std;
const int N = 100;
long long n, m;
long long k;
long long mat[N][N];
long long ans = 0;
map<int64_t, int64_t> mp[22][22];
void solve(int a, int b, int rem, int64_t xr) {
  if (a < 1 or b < 1 or a > n or b > m) return;
  xr = xr xor mat[a][b];
  if (rem == 0) {
    ++mp[a][b][xr];
    return;
  }
  solve(a + 1, b, rem - 1, xr);
  solve(a, b + 1, rem - 1, xr);
}
void solve1(int x, int y, int rem, int64_t xr) {
  if (x < 1 or y < 1 or x > n or y > m) return;
  if (rem == 0) {
    ans += mp[x][y][xr ^ k];
    return;
  }
  xr = xr ^ mat[x][y];
  solve1(x - 1, y, rem - 1, xr);
  solve1(x, y - 1, rem - 1, xr);
}
int main(void) {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> mat[i][j];
  int half1 = (n + m - 2) / 2;
  int half2 = (n + m - 2) - half1;
  solve(1, 1, half1, 0);
  solve1(n, m, half2, 0);
  cout << ans << endl;
}
