// NOTE: it is recommended to use this even if you don't understand the following code.

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

#define MAXN 500
#define MAXM 500

int       M, N, i, j;
int       A[MAXN][MAXM], C[MAXN][MAXM];
long long K;

int main() {
    // uncomment the two following lines if you want to read/write from files
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    assert(2 == scanf("%d%d", &N, &M));

    for (j = 0; j < N; ++j) {
        for (i = 0; i < M; ++i)
            assert(1 == scanf("%d", &A[j][i]));
    }

    for (j = 0; j < N; ++j) {
        for (i = 0; i < M; ++i)
            assert(1 == scanf("%d", &C[j][i]));
    }

    K = 0;


    // INSERT YOUR CODE HERE


    printf("%lld\n", K);

    return 0;
}
