#include <bits/stdc++.h>
using namespace std;
int n, x[100][100], br;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
        cin >> x[i][j];
    }
}

for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
        if (x[i][j] == 0 and x[i][j+1] == 0) {
            br++;
        }
    }
}

cout << br/n << endl;
return 0;
}