P11330 [AOJ] Vector Field
普及
题目描述

Example

Input

9
0 0 v
1 0 >
2 0

Output

9

输入格式

见题面

输出格式

见题面

样例输入
9 0 0 v 1 0 > 2 0
样例输出
9