#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e2 + 10;
const long long mod = 1e9 + 7;
const long long INF = 1e9;
inline long long bpow(long long t, long long n) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) ans = (ans * t) % mod;
    t = (t * t) % mod, n >>= 1;
  }
  return ans;
}
int a[MAX_N][MAX_N];
int row[MAX_N];
int col[MAX_N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) row[i] += a[i][j], col[j] += a[i][j];
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    ans += (1ll << row[i]) - 1 + (1ll << (m - row[i])) - 1;
  for (int j = 1; j <= m; j++)
    ans += (1ll << col[j]) - 1 + (1ll << (n - col[j])) - 1;
  ans -= n * m;
  cout << ans;
}
