#include <bits/stdc++.h>
int H, W, a[212][212];
long long int ans;
int main() {
  std::cin >> H >> W;
  for (long long int i = 0; i < H; ++i) {
    for (long long int j = 0; j < W; ++j) {
      std::cin >> a[i][j];
    }
  }
  for (long long int i = 0; i < H; ++i) {
    for (long long int j = 0; j < W; ++j) {
      ans += a[i][j];
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
