#include <stdio.h>
int main ()
{
int N,i,j;
int a[N+1][N+1];
for(int i =0; i<N; i++){
for(int j=0; j<N; j++){
}
}
int cnt=0;
for( i =0; i<N; i++){
for( j=0; j<N; j++){
if(i == j & a[i][j] == 1)
{
cnt++;
}
}
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBtYWluICgpCnsKICAgIGludCBOLGksajsKICAgIHNjYW5mKCIlZCIsICZOKTsKCiAgICBpbnQgYVtOKzFdW04rMV07CgogICAgZm9yKGludCBpID0wOyBpPE47IGkrKyl7CiAgICAgICAgZm9yKGludCBqPTA7IGo8TjsgaisrKXsKICAgICAgICAgICAgc2NhbmYoIiVkIiwgJmFbaV1bal0pOwogICAgICAgIH0KICAgIH0KICAgIGludCBjbnQ9MDsKICAgIGZvciggaSA9MDsgaTxOOyBpKyspewogICAgICAgIGZvciggaj0wOyBqPE47IGorKyl7CiAgICAgICAgICAgIGlmKGkgPT0gaiAmIGFbaV1bal0gPT0gMSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgY250Kys7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgfQogICAgaWYgKGNudCA9PSBOKSBwcmludGYoIllFUyIpOwogICAgZWxzZSBwcmludGYoIk5PIik7Cn0KCg==