#include <bits/stdc++.h>
using namespace std;
int a[300][300];
int main() {
  int h, w;
  scanf("%d%d", &h, &w);
  for (long long i = 0; i < h; i++)
    for (long long j = 0; j < w; j++) {
      scanf("%d", &a[i][j]);
    }
  printf("%d\n", accumulate(a[0], a[300], 0));
}
