#include <algorithm>
#include <vector>
#include <string>
#include <queue>

#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

const int MAXN = 2010;

int n;
char grid[ MAXN ][ MAXN ];

int L[ MAXN ][ MAXN ];
int R[ MAXN ][ MAXN ];

int F[ MAXN ];
priority_queue< pair< int, int > > pq;

void update( int x, int val ) { for( ++x; x < MAXN; x += x&-x ) F[x] += val; }
int query( int x ) { int sum = 0; for( ++x; x > 0; x -= x&-x ) sum += F[x]; return sum; }

int solve( int s, int r1, int r2 )
{
    if( r2-r1 < 2 ) return 0;

    int sum = 0;
    int pos = 0;
    for( ; !pq.empty(); pq.pop() );

    for( int i = r1; i <= r2; i += 2, ++pos ) {
        for( ; !pq.empty() && -pq.top().first < pos; pq.pop() )
            update( pq.top().second, -1 );

        sum += query( pos-1 ) - query( pos - R[i][s] - 1 );
        pq.push( pair< int, int >( -( L[i][s] + pos ), pos ) );
        update( pos, 1 - query( pos ) + query( pos-1 ) );
    }

    return sum;
}

int main( void )
{
    scanf( "%d", &n );

    for( int i = 0; i < n; ++i ) {
        scanf( "%s", grid[i] );

        for( int j = 1; j < n; ++j )
            if( grid[i][j-1] == '.' )
                L[i][j] = L[i][j-1] + 1;

        for( int j = n-2; j >= 0; --j )
            if( grid[i][j+1] == '.' )
                R[i][j] = R[i][j+1] + 1;
    }

    int sum = 0;

    for( int j = 0; j < n; ++j ) {
        int last = -1;

        for( int i = 0; i <= n; ++i )
            if( i == n || grid[i][j] == 'x' ) {
                sum += solve( j, last+1, i-1 );
                sum += solve( j, last+2, i-1 );
                last = i;
            }
    }

    printf( "%d\n", sum );
    return 0;
}

