#include <bits/stdc++.h>
using namespace std;
long long x, y, w, n, i, j, k, l, t = 1, ans = 0, flag = 0, m,
                                  a[105][105] = {0}, r[105] = {0}, c[105] = {0};
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) cin >> a[i][j];
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) r[i] += a[i][j];
  }
  for (j = 1; j <= m; j++) {
    for (i = 1; i <= n; i++) c[j] += a[i][j];
  }
  for (i = 1; i <= n; i++) {
    ans += power(2LL, r[i]) - 1 + power(2LL, m - r[i]) - 1;
  }
  for (i = 1; i <= m; i++) {
    ans += power(2LL, c[i]) - 1 + power(2LL, n - c[i]) - 1;
  }
  ans -= m * n;
  cout << ans << endl;
  return 0;
}
