#include<bits/stdc++.h>
using namespace std;
char a[1010][1010];
string c="oo.";
int n,m,b[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
bool f(int x,int y,int fx,int s){
if(s==2){
return 1;
}
if(x>=0&&y>=0&&x<n&&y<m&&a[x+b[fx][0]][y+b[fx][1]]==c[s+1]){
return f(x+b[fx][0],y+b[fx][1],fx,s+1);
}
return 0;
}
int main(){
int sum=0;
n=7,m=7;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
a[i][j]=getchar();
}
getchar();
}
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(a[i][j]=='o'){
for(int k=0;k<4;k++){
if(f(i,j,k,0)){
sum++;
}
}
}
}
}
cout<<sum;
}