/*
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
*/
/*
#include<stdio.h>
#define MAXSIZE 5
int queue[MAXSIZE] = {};
int front, rear;
void input(int k)
{
if(front==MAXSIZE && rear != 0)
{
for(int i=0;i<front-rear;i++)
{
queue[i]=queue[rear+i];
queue[rear+i]=0;
}
front-=rear;
rear=0;
}
else if(front==MAXSIZE&&rear==0)
{
printf("Queue is FULL\n");
return;
}
queue[front++] = k;
}
void output()
{
if(rear==front)
{
printf("Queue is NULL\n");
return;
}
printf("output data is %d\n",queue[rear]);
queue[rear] = 0;
rear++;
if(rear == front)
{
rear = front = 0;
}
}
void view()
{
for(int i=0; i<MAXSIZE; i++)
{
printf("%d : %d", i, queue[i]);
if(front == i)
{
printf("<= FRONT");
}
if(rear == i)
{
printf("<= REAR");
}
printf("\n");
}
}
int main()
{
int k, n;
for(;;)
{
printf("1:input, 2:output, 3:view\nInput:> ");
scanf("%d", &n);
switch(n)
{
case 1:
printf("Input Value : ");
scanf("%d", &k);
input(k);
break;
case 2:
output();
break;
case 3:
view();
break;
}
}
}
*/
#include<stdio.h>
int main()
{
int map[25][25]={0};
int i,j,n,sum=0,c=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<n;ij++)
{
scanf("%1d",&map[i][j]);
}
}
if(map[i][j]==1)
{
if(map[i][j+1]==1 || map[i+1][j]==1 || map[i-1][j]==1 || map[i][j-1]==1)
{
sum+=1;
c++;
}
}
return 0;
}