1#include <bits/stdc++.h>2using namespace std;3int main() {4 for(int i=1;i<=5;i++) {5 for(int j=1;j<=5;j++) {6 int x;cin>>x;7 if(x==1) {8 cout<<abs(3-i)+abs(3-j);9 }10 }11 }12}