Problem A - Robot Instructions

Time Limit: 3 sec

Description

You have a robot standing on the origin of x axis. The robot will be given some instructions. Your task is to predict its position after executing all the instructions.

Input

The first line contains the number of test cases T (T≤100). Each test case begins with an integer n ( 1≤n≤100), the number of instructions. Each of the following n lines contains an instruction.

Output

For each test case, print the final position of the robot. Note that after processing each test case, the robot should be reset to the origin.

Sample Input

2
3
LEFT
RIGHT
SAME AS 2
5
LEFT
SAME AS 1
SAME AS 2
SAME AS 1
SAME AS 4

Sample Output

1
-5

Copyright © 2015 Ming Tsay, MCC. All rights reserved.