{"raw_statement":[{"iden":"problem statement","content":"You are given an $N \\times N$ grid. Let $(i,j)$ denote the cell in the $i$\\-th row from the top and the $j$\\-th column from the left.  \nThe states of the cells are given by $N$ strings of length $N$, $S_1, S_2, \\dots, S_N$, in the following format:\n\n*   If the $j$\\-th character of $S_i$ is `o`, there is an `o` written in cell $(i,j)$.\n*   If the $j$\\-th character of $S_i$ is `x`, there is an `x` written in cell $(i,j)$.\n\nFind the number of triples of cells that satisfy all of the following conditions:\n\n*   The three cells in the triple are distinct.\n*   All three cells have an `o` written in them.\n*   Exactly two of the cells are in the same row.\n*   Exactly two of the cells are in the same column.\n\nHere, two triples are considered different if and only if some cell is contained in exactly one of the triples."},{"iden":"constraints","content":"*   $N$ is an integer between $2$ and $2000$, inclusive.\n*   $S_i$ is a string of length $N$ consisting of `o` and `x`."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$S_1$\n$S_2$\n$\\vdots$\n$S_N$"},{"iden":"sample input 1","content":"3\nooo\noxx\nxxo"},{"iden":"sample output 1","content":"4\n\nThe following four triples satisfy the conditions:\n\n*   $(1,1),(1,2),(2,1)$\n*   $(1,1),(1,3),(2,1)$\n*   $(1,1),(1,3),(3,3)$\n*   $(1,2),(1,3),(3,3)$"},{"iden":"sample input 2","content":"4\noxxx\nxoxx\nxxox\nxxxo"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"15\nxooxxooooxxxoox\noxxoxoxxxoxoxxo\noxxoxoxxxoxoxxx\nooooxooooxxoxxx\noxxoxoxxxoxoxxx\noxxoxoxxxoxoxxo\noxxoxooooxxxoox\nxxxxxxxxxxxxxxx\nxooxxxooxxxooox\noxxoxoxxoxoxxxo\nxxxoxxxxoxoxxoo\nxooxxxooxxoxoxo\nxxxoxxxxoxooxxo\noxxoxoxxoxoxxxo\nxooxxxooxxxooox"},{"iden":"sample output 3","content":"2960"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}