#include <cstdio>
#include <cstring>

char a[60][60];
int dx[]={0,0,1,-1},dy[]={1,-1,0,0};//r,l,d,u;

int main()
{
    int n,i,j,k;
    int tmpx,tmpy,ans,legal,lenth[5];
    while(1)
    {
        scanf("%d",&n);
        if(!n) break;
        ans=0;
        for(i=0;i<n;i++) scanf("%s",a[i]);
        for(i=0;i<n;i++)
            for(j=0;j<n;j++)
            {
                if(a[i][j]!='#') continue;
                legal=1;
                for(k=0;k<4;k++) lenth[k]=0;

                tmpx=i,tmpy=j;
                while(1)
                {
                    tmpx+=dx[0],tmpy+=dy[0];
                    if(tmpx<0||tmpx>=n||tmpy<0||tmpy>=n||a[tmpx][tmpy]!='#') break;
                    lenth[0]++;
                    if((tmpx-1>=0&&a[tmpx-1][tmpy]=='#')||(tmpx+1<n&&a[tmpx+1][tmpy]=='#'))
                    {
                        legal=0;
                        break;
                    }
                }

                tmpx=i,tmpy=j;
                while(1)
                {
                    tmpx+=dx[1],tmpy+=dy[1];
                    if(tmpx<0||tmpx>=n||tmpy<0||tmpy>=n||a[tmpx][tmpy]!='#') break;
                    lenth[1]++;
                    if((tmpx-1>=0&&a[tmpx-1][tmpy]=='#')||(tmpx+1<n&&a[tmpx+1][tmpy]=='#'))
                    {
                        legal=0;
                        break;
                    }
                }

                tmpx=i,tmpy=j;
                while(1)
                {
                    tmpx+=dx[2],tmpy+=dy[2];
                    if(tmpx<0||tmpx>=n||tmpy<0||tmpy>=n||a[tmpx][tmpy]!='#') break;
                    lenth[2]++;
                    if((tmpy-1>=0&&a[tmpx][tmpy-1]=='#')||(tmpy+1<n&&a[tmpx][tmpy+1]=='#'))
                    {
                        legal=0;
                        break;
                    }
                }

                tmpx=i,tmpy=j;
                while(1)
                {
                    tmpx+=dx[3],tmpy+=dy[3];
                    if(tmpx<0||tmpx>=n||tmpy<0||tmpy>=n||a[tmpx][tmpy]!='#') break;
                    lenth[3]++;
                    if((tmpy-1>=0&&a[tmpx][tmpy-1]=='#')||(tmpy+1<n&&a[tmpx][tmpy+1]=='#'))
                    {
                        legal=0;
                        break;
                    }
                }
                printf("\n%d %d:\n",i,j);
                for(i=0;i<4;i++) printf("%d ",lenth[i]);
                printf("\n");
                if(!legal) continue;
                if(lenth[0]>0&&lenth[0]==lenth[1]&&lenth[1]==lenth[2]&&lenth[2]==lenth[3])
                    ans++;
            }
        printf("%d\n",ans);
    }
    return 0;
}