#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef long long LL; #define all(a) (a).begin(), (a).end() #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl #define YES(n) cout << ((n) ? "YES" : "NO" ) << endl #define ALL(a) (a).begin(),(a).end() #define pb push_back int main() {std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); LL n;cin>>n; string s; VI B; LL wa=0; rep(i,n){cin>>s; rep(j,2*n){ if(s[j]=='#'){wa+=j+1; B.pb(i);} } } LL ans=n*n*(3*n+1)/2-wa; sort(all(B)); //cout<