#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
long long n, m;
long long a[20][20];
long long k;
map<long long, long long> mp[20][20];
int vis[20][20];
bool chek(long long x, long long y) {
  if (x < n && y < m) return 1;
  return 0;
}
void dfsUtil(long long i, long long j, long long x, long long y, long long M) {
  if (x == n - 1 && y == m - 1)
    mp[i][j][M ^ a[x][y]]++;
  else {
    if (chek(x + 1, y)) dfsUtil(i, j, x + 1, y, (M ^ a[x][y]));
    if (chek(x, y + 1)) dfsUtil(i, j, x, y + 1, (M ^ a[x][y]));
  }
}
void dfs(long long x, long long y, long long M) {
  if (x + y + 2 >= (n + m) / 2) {
    if (vis[x][y] == 1) {
      ans += mp[x][y][M ^ k];
    } else {
      vis[x][y] = 1;
      dfsUtil(x, y, x, y, 0);
      ans += mp[x][y][M ^ k];
    }
  } else if (x + y + 2 < (n + m) / 2) {
    if (chek(x + 1, y)) dfs(x + 1, y, (M ^ a[x][y]));
    if (chek(x, y + 1)) dfs(x, y + 1, (M ^ a[x][y]));
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(vis, 0, sizeof(vis[0][0]) * 400);
  cin >> n >> m >> k;
  for (long long i = (long long)0; i < (long long)n; i++)
    for (long long j = (long long)0; j < (long long)m; j++) cin >> a[i][j];
  dfs(0, 0, 0);
  cout << ans;
}
