{"problem":{"name":"Counting Ls","description":{"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.   The states of the cells are given by $N$ strings of length $N$, ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc330_d"},"statements":[{"statement_type":"Markdown","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.\n\n## Constraints\n\n*   $N$ is an integer between $2$ and $2000$, inclusive.\n*   $S_i$ is a string of length $N$ consisting of `o` and `x`.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$S_1$\n$S_2$\n$\\vdots$\n$S_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc330_d","tags":[],"sample_group":[["3\nooo\noxx\nxxo","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)$"],["4\noxxx\nxoxx\nxxox\nxxxo","0"],["15\nxooxxooooxxxoox\noxxoxoxxxoxoxxo\noxxoxoxxxoxoxxx\nooooxooooxxoxxx\noxxoxoxxxoxoxxx\noxxoxoxxxoxoxxo\noxxoxooooxxxoox\nxxxxxxxxxxxxxxx\nxooxxxooxxxooox\noxxoxoxxoxoxxxo\nxxxoxxxxoxoxxoo\nxooxxxooxxoxoxo\nxxxoxxxxoxooxxo\noxxoxoxxoxoxxxo\nxooxxxooxxxooox","2960"]],"created_at":"2026-03-03 11:01:14"}}