#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = acos(-1.0);
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int64_t H, W;
  vector<vector<int64_t>> a(H, vector<int64_t>(W, 0));
  for (int64_t i = (int64_t)(0); i < (int64_t)(H); i++)
    for (int64_t j = (int64_t)(0); j < (int64_t)(W); j++) cin >> a[i][j];
  assert(H <= 2);
  int64_t ans = 0;
  for (int64_t i = (int64_t)(0); i < (int64_t)(H); i++)
    for (int64_t j = (int64_t)(0); j < (int64_t)(W); j++) ans += a[i][j];
  cout << ans << endl;
  return 0;
}
