#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, W, T1, w;
  cin >> H >> W;
  w = H * W;
  T1 = 0;
  int array[w];
  for (int i = 0; i < w; i++) {
    cin >> array[i];
    T1 = T1 + array[i];
  }
  cout << T1 << endl;
  return 0;
}
