#include <iostream>
using namespace std;
int main() {
int n, m;
cin >> m >> n;
long long s[m][n], h=0;
for(int i=0; i<m; i++)
{
for(int j=0; j<n; j++)
{
cin >> s[i][j];
}
}
for(int i=0; i<n; i++)
{
h+=s[0][i];
}
cout << m*h;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewogICAgaW50IG4sIG07CiAgICBjaW4gPj4gbSA+PiBuOwogICAgbG9uZyBsb25nIHNbbV1bbl0sIGg9MDsKICAgIGZvcihpbnQgaT0wOyBpPG07IGkrKykKICAgIHsKICAgIAlmb3IoaW50IGo9MDsgajxuOyBqKyspCiAgICAJewogICAgICAgIAljaW4gPj4gc1tpXVtqXTsKICAgICAgICB9CiAgICB9CiAgICBmb3IoaW50IGk9MDsgaTxuOyBpKyspCiAgICB7CiAgICAJaCs9c1swXVtpXTsKICAgIH0KICAgIGNvdXQgPDwgbSpoOwogICAgcmV0dXJuIDA7Cn0=