#include using namespace std; #include using namespace atcoder; #define rep(i,n) for (int i = 0; i < (n); ++i) using ld = long double; using ll = long long; template bool chmax(T &a, T b) { if(a bool chmin(T &a, T b) { if(a>b) { a = b; return true; } return false; } int N; string S[100]; int main() { cin >> N; rep(i,N) cin >> S[i]; int ans = 0; rep(i,N) rep(j,N) if(S[i][j]=='.') { int fn = 0; { bool ok = true; rep(k,N) if(k!=j&&S[i][k]!='A') ok = false; if(ok) fn++; } { bool ok = true; rep(k,N) if(k!=i&&S[k][j]!='A') ok = false; if(ok) fn++; } if(i==j) { bool ok = true; rep(k,N) if(k!=i&&S[k][k]!='A') ok = false; if(ok) fn++; } if(i+j==N-1) { bool ok = true; rep(k,N) if(k!=i&&S[k][N-1-k]!='A') ok = false; if(ok) fn++; } ans += fn; } cout << ans << endl; }