P12045 [AOJ] Wall Clocks
普及
题目描述

Example

Input

2 10 6
4 4 E
6 4 W

Output

2

输入格式

见题面

输出格式

见题面

样例输入
2 10 6 4 4 E 6 4 W
样例输出
2