6183 - 例4.8 格子游戏
时间限制 : 1 秒
内存限制 : 128 MB

输入

输出

样例
输入
3 5 1 1 D 1 1 R 1 2 D 2 1 R 2 2 D
输出
4
来源
一本通