첫째 줄에 방의 크기 N이 주어진다. N은 1이상 100이하의 정수이다. 그 다음 N줄에 걸쳐 N개의 문자가 들어오는데 '.'은 아무것도 없는 곳을 의미하고, 'X'는 짐이 있는 곳을 의미한다.
첫째 줄에 가로로 누울 수 있는 자리와 세로로 누울 수 있는 자리의 개수를 출력한다.
import java.io.*;
public class _1652 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
char[][] arr = new char[n][n];
for(int i = 0; i < n; i++) {
String[] val = br.readLine().split("");
for(int j = 0; j < n; j++) {
arr[i][j] = val[j].charAt(0);
}
}
int rval = 0, cval = 0;
for(int i = 0; i < n; i++) {
for (int j = 0 ; j < n; j++) {
if(i + 1 < n) {
if (arr[i][j] == '.' && arr[i+1][j] == '.' && (i + 2 >= n || arr[i+2][j] == 'X')) {
cval += 1;
}
}
if(j + 1 < n) {
if (arr[i][j] == '.' && arr[i][j + 1] == '.' && (j + 2 >= n || arr[i][j + 2] == 'X')) {
rval += 1;
}
}
}
}
System.out.println(rval + " " + cval);
}
}