Glory Graph

아직 제출이 없습니다시간 제한3초메모리 제한512 MB

문제

You are given a complete undirected graph on nn vertices, each edge is colored blue or yellow. Anton likes a subgraph on 44 vertices if, among its 66 edges, 55 edges have one color, and the 66-th edge has another color. Yahor likes a subgraph on 44 vertices if 33 of its edges are yellow, 33 are blue, and no 33 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 AA be the number of subgraphs Anton likes, and YY be the number of subgraphs Yahor likes. They want to know who likes more subgraphs. To help them, find the value YAY - A.

입력

The first line of the input contains a single integer nn (4n20004 \le n \le 2000), the number of vertices in the graph.

The ii-th of the next ii lines contains a string s_is\_i of length nn

It is guaranteed that:

  • For every ii from 11 to nn, the ii-th character of s_is\_i is '-'
  • For every iji \neq j, the jj-th character of s_is\_i is either 'Y' or 'B', where' Y' shows that the edge between vertices ii and jj is yellow, and 'B' shows that it is blue
  • For every iji \neq j, the jj-th character of s_is\_i is equal to the ii-th character of s_js\_j

출력

Output a single integer: the value YAY - A.