Given a tree of size n(\leq 10^5) with each vertex colored either black or white. Find the number of paths with alternating colors.

Input: First line will have *n*, the number of vertices of the tree and then *n-1* lines will follow of the form *u v* which denote an edge between the vertex u and v. Finally, the next line will contain the space separated color(either W for white or B for Black) of each vertex.

Output: Single number denoting the number of paths with alternating colors.

Sample Input

3

1 2

1 3

W B B

Sample Output

6

Explanation:

[1],[2],[3],[1,2],[1,3],[1,2,3]