Problem

There is a grid of $ N \ times N $ cells. Initially all cells are white. Follow the steps below to increase the number of black squares.

Select one white cell from the cells that are even-numbered from the top and even-numbered from the left. The selected square turns black. Further, the adjacent white squares also change to black in a chain reaction in each of the vertical and horizontal directions of the squares. This chain continues until there are no white cells in that direction. (An example is shown below)

□□□□□□□□□
□□□□□□□□□
□□□□□□□□□
□□□□□□□□□
□□□□□□□□□
□□□□□□□□□
□□□□□□□□□
□□□□□□□□□
□□□□□□□□□
↓ Select the 4th from the top and the 6th from the left
□□□□□ ■ □□□
□□□□□ ■ □□□
□□□□□ ■ □□□
■■■■■■■■■
□□□□□ ■ □□□
□□□□□ ■ □□□
□□□□□ ■ □□□
□□□□□ ■ □□□
□□□□□ ■ □□□
↓ Select the second from the top and the second from the left
□ ■ □□□ ■ □□□
■■■■■■ □□□
□ ■ □□□ ■ □□□
■■■■■■■■■
□□□□□ ■ □□□
□□□□□ ■ □□□
□□□□□ ■ □□□
□□□□□ ■ □□□
□□□□□ ■ □□□
↓ Select 6th from the top and 8th from the left
□ ■ □□□ ■ □□□
■■■■■■ □□□
□ ■ □□□ ■ □□□
■■■■■■■■■
□□□□□ ■ □ ■ □
□□□□□ ■■■■
□□□□□ ■ □ ■ □
□□□□□ ■ □ ■ □
□□□□□ ■ □ ■ □


You want to create a grid where the color of the $ i $ th cell from the top and the $ j $ th cell from the left is $ A_ {i, j} $. Find the minimum number of times to select a square.

Constraints

The input satisfies the following conditions.

* $ 3 \ le N \ le 127 $
* $ N $ is odd
* $ A_ {i, j} $ is'o'or'x'
* Only input that can be made is given

Input

The input is given in the following format.

$ N $
$ A_ {1,1} $ $ A_ {1,2} $ ... $ A_ {1, N} $
$ A_ {2,1} $ $ A_ {2,2} $ ... $ A_ {2, N} $
...
$ A_ {N, 1} $ $ A_ {N, 2} $ ... $ A_ {N, N} $


When $ A_ {i, j} $ is'o', it means that the $ i $ th cell from the top and the $ j $ th cell from the left are white, and when it is'x', it is a black cell. Represents that.

Output

Outputs the minimum number of times to select a cell on the first line.

Examples

Input

5
oxooo
oxooo
oxooo
xxxxx
oxooo


Output

1


Input

9
oxoooooxo
oxxxxxxxx
oxoooooxo
xxxxxxxxx
oxoxooooo
oxxxxxxxx
oxoxoxooo
oxoxxxxxx
oxoxoxooo


Output

4
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

int n;
char c[200][200];
int ans = 0;

// void calc(int r0, int c0, int r1, int c1){
//     // cout << r0 << " " << c0 << " " << r1 << " " << c1 << " " << ans << endl;    
//     int tate = -1;
//     int yoko = -1;
//     rep(i, r0, r1 + 1){
//         rep(j, c0, c1 + 1){
//             if(c[i][j] != 'x') break;
//             if(j == c1){
//                 yoko = i; i = r1 + 1;
//             }
//         }
//     }
//     rep(i, c0, c1 + 1){
//         rep(j, r0, r1 + 1){
//             if(c[j][i] != 'x') break;
//             if(j == r1){
//                 tate = i; i = c1 + 1;
//             }
//         }
//     }
//     cout << r0 << " " << c0 << " " << r1 << " " << c1 << " " << ans << " " << tate << " " << yoko << endl;    
//     if(tate == -1 || yoko == -1) return;
//     ans++;
//     calc(r0, c0, yoko - 1, tate - 1);
//     calc(r0, tate + 1, yoko - 1, c1);
//     calc(yoko + 1, c0, r1, tate - 1);
//     calc(yoko + 1, tate + 1, r1, c1);
// }

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    rep(i, 0, n){
        rep(j, 0, n){
            cin >> c[i][j];
        }
    }
    // calc(0, 0, n - 1, n - 1);
    rep(i, 0, n){
        rep(j, 0, n){
            if(c[i][j] == 'o'){
                ans++;
                rep(k, i, n){
                    rep(l, j, n){
                        if(c[k][l] == 'x'){
                            if(l == j){ k = n; break;}
                            break;
                        }
                        if(c[k][l] != 'x') c[k][l] = '!';
                    }
                }
            }
            // rep(k, 0, n){
            //     rep(l, 0, n){
            //         cout << c[k][l];
            //     }
            //     cout << endl;
            // }
            // cout << "===" << endl;
        }
    }
    // cout << ans << endl;
    cout << (ans - 1) / 3 << endl;
}
/*
7
oooxoxo
xxxxxxo
oooxoxo
xxxxxxx
oooxoxo
xxxxxxo
oooxoxo

ans: 3

*/