#include<iostream>using namespace std;int a[101][101],n;int f(int i,int j){ int s1=0,s2=0; for (int k=1;k<=n;k++) { s1=s1+a[i][k]; s2=s2+a[k][j]; } if (s1==s2) return 1; return 0;}int main(){ int c=0; cout<<"n="; cin>>n; for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) { cout<<"a["<<i<<"]["<<j<<"]="; cin>>a[i][j]; } for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) if (f(i,j)==1) c++; cout<<c;}