#include <stdio.h>
#include <stdlib.h>
//对角线规律,左上到右下规律,行列相等
//右上到坐下,行+列==N
int main(void)
{
int num[10][10];
int a;
scanf("%d",&a);
int sum = 0;
int i,j;
int b = 0;
for(i=0;i<a;i++)
{
for(j=0;j<a;j++)
{
scanf("%d",&num[i][j]);
}
}
if(a%2==0)
{
for(i=0;i<a;i++)
{
for(j=0;j<a;j++)
{
if(i==j)
{
sum = sum +num[i][j];
if(num[i][j]==0)
{
b+=1;
}
}
if(i+j==a-1)
{
sum = sum +num[i][j];
if(num[i][j]==0)
{
b +=1;
}
}
}
}
printf("sum = %d, count = %d.\n",sum,2*a-b);
}
if(a%2 !=0)
{
for(i=0;i<a;i++)
{
for(j=0;j<a;j++)
{
if(i==j)
{
sum = sum +num[i][j];
if(num[i][j]==0)
{
b+=1;
}
}
if(i+j==a-1)
{
sum = sum +num[i][j];
if(num[i][j]==0)
{
b +=1;
}
}
}
}
printf("sum = %d, count = %d.\n",sum-num[a/2][a/2],2*a-b-1);
}
system("pause");
return 0;
}