#include<stdio.h>

int main(int argc, char const *argv[]) {
    int h,w,map[200][200],i,j,sum;
    
    scanf("%d %d",&h,&w);
    sum=0;
    for (i = 0; i < h; i++) {
        for (j = 0; j < w; j++) {
            scanf("%d",%map[i][j]);
            sum+=map[i][j];
        }
    }
    printf("%d",sum);
    return 0;
}
