|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|3 초||512 MB||0||0||0||0.000%|
You are given a complete undirected graph on $n$ vertices, each edge is colored blue or yellow. Anton likes a subgraph on $4$ vertices if, among its $6$ edges, $5$ edges have one color, and the $6$-th edge has another color. Yahor likes a subgraph on $4$ vertices if $3$ of its edges are yellow, $3$ are blue, and no $3$ vertices form a triangle with edges of the same color.
On the image below, on the left, you can see examples of graphs Anton likes. On the right, there are examples of graphs Yahor likes.
Let $A$ be the number of subgraphs Anton likes, and $Y$ be the number of subgraphs Yahor likes. They want to know who likes more subgraphs. To help them, find the value $Y - A$.
The first line of the input contains a single integer $n$ ($4 \le n \le 2000$), the number of vertices in the graph.
The $i$-th of the next $i$ lines contains a string $s_i$ of length $n$.
It is guaranteed that:
Y' or '
Y' shows that the edge between vertices $i$ and $j$ is yellow, and '
B' shows that it is blue
Output a single integer: the value $Y - A$.
5 -YBYB Y-BBB BB-BY YBB-Y BBYY-
6 -YYYYY Y-YYBB YY-YYY YYY-YB YBYY-Y YBYBY-