#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long a[25][25];
map<long long, long long> mp[25];
void func(long long r, long long c, long long xsum) {
  if ((r + c) == (m + n) / 2 + 1) {
    mp[r][xsum ^ a[r][c]]++;
    return;
  }
  if (r < n) func(r + 1, c, xsum ^ a[r][c]);
  if (c < m) func(r, c + 1, xsum ^ a[r][c]);
  return;
}
long long func2(long long r, long long c, long long xsum) {
  if (r < 1 || c < 1) return 0;
  if ((r + c) == (m + n) / 2 + 1) return mp[r][k ^ xsum];
  return func2(r, c - 1, xsum ^ a[r][c]) + func2(r - 1, c, xsum ^ a[r][c]);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m >> k;
  for (long long i = 1; i <= n; ++i)
    for (long long j = 1; j <= m; ++j) cin >> a[i][j];
  func(1, 1, 0);
  cout << func2(n, m, 0);
  return 0;
}
