#include <bits/stdc++.h>
using namespace std;
unordered_map<long long int, long long int> mp;
long long int n, m, k, ans;
long long int a[22][22];
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
void dfs1(int ex, int ey, int sx, int sy, long long int cur) {
  if (sx == ex and sy == ey) mp[cur]++;
  if (sx < ex) dfs1(ex, ey, sx + 1, sy, cur ^ (a[sx][sy]));
  if (sy < ey) dfs1(ex, ey, sx, sy + 1, cur ^ (a[sx][sy]));
}
void dfs(int x, int y, long long int cur) {
  if (x == n - 1 and y == m - 1) cur ^= a[x][y], ans += mp[cur ^ k];
  if (x < n - 1) dfs(x + 1, y, cur ^ (a[x][y]));
  if (y < m - 1) dfs(x, y + 1, cur ^ (a[x][y]));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  int mid = (n + m - 2) / 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i + j == mid) {
        dfs1(i, j, 0, 0, 0);
        dfs(i, j, 0);
        mp.clear();
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
