#include <bits/stdc++.h>
using namespace std;
long long arr[21][21];
vector<long long> upper, lower;
void brute(long long i, long long j, long long rowEnd, long long colEnd,
           long long isUpper, long long xorr) {
  if (i > rowEnd || j > colEnd) return;
  xorr ^= arr[i][j];
  if (i == rowEnd && j == colEnd) {
    if (isUpper) {
      xorr ^= arr[i][j];
      upper.push_back(xorr);
    } else {
      lower.push_back(xorr);
    }
  }
  brute(i + 1, j, rowEnd, colEnd, isUpper, xorr);
  brute(i, j + 1, rowEnd, colEnd, isUpper, xorr);
}
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> arr[i][j];
    }
  }
  long long ans = 0;
  bool swapped = false;
  long long minn = min(n, m);
  for (int i = 0; i < minn; i++) {
    brute(0, 0, i, minn - 1 - i, 1, 0);
    brute(i, minn - 1 - i, n - 1, m - 1, 0, 0);
    sort(lower.begin(), lower.end());
    for (int j = 0; j < upper.size(); j++) {
      long long val = k ^ upper[j];
      ans += (upper_bound(lower.begin(), lower.end(), val) -
              lower_bound(lower.begin(), lower.end(), val));
    }
    upper.clear();
    lower.clear();
  }
  cout << ans << "\n";
}
