#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long SUM = 0, ff = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') ff = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    SUM = (SUM << 3) + (SUM << 1) + (ch ^ 48);
    ch = getchar();
  }
  return SUM * ff;
}
const int N = 30;
long long a[N][N];
long long n, m, k;
map<long long, long long> dp[N];
inline void dfs1(int x, int y, long long sum) {
  if (x > n || y > m) return;
  if ((x + y) == (n + m) / 2 + 1) {
    dp[x][sum ^ a[x][y]]++;
    return;
  }
  dfs1(x + 1, y, sum ^ a[x][y]);
  dfs1(x, y + 1, sum ^ a[x][y]);
}
inline long long dfs2(int x, int y, long long sum) {
  if (x < 1 || y < 1) return 0;
  if ((x + y) == (n + m) / 2 + 1) return dp[x][sum];
  return dfs2(x - 1, y, sum ^ a[x][y]) + dfs2(x, y - 1, sum ^ a[x][y]);
}
int main() {
  n = read(), m = read(), k = read();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[i][j] = read();
  dfs1(1, 1, 0);
  printf("%lld\n", dfs2(n, m, k));
  return 0;
}
