#include<stdio.h>
#include<stdlib.h>
int main()
{
int i, j;
int temp;
int t_i, t_j;
int ans;
for(i=1; i<=5; ++i)
for(j=1; j<=5; ++j)
{
scanf("%d",&temp);
if(temp!=0)
{
t_i=i;
t_j=j;
}
}
ans=abs(t_i-3)+abs(t_j-3);
printf("%d\n", ans);
return 0;
}
posted on
浙公网安备 33010602011771号