#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, w;
  int a[205][205];
  cin >> h >> w;
  for (int i = 0; i < h; i++)
    for (int j = 0; j < w; j++) cin >> a[i][j];
  assert(h <= 2);
  long long sum = 0;
  for (int i = 0; i < h; i++)
    for (int j = 0; j < w; j++) sum += a[i][j];
  cout << sum << endl;
  return 0;
}
