Since it's Valentines, XORin and XORina will take a stroll in a romantic city. The city can be represented as a N x M board. This time they will respect a pattern. The pattern is a string, each character having the following meaning:
The second line contains K(the length of the pattern).
The next line contains the pattern.
0 ≤ K ≤ N*M
- U - they move from the current cell (i,j) to the cell in front of them (i-1,j)
- D - they move from the current cell (i,j) to the cell behind them (i+1,j)
- L - they move from the current cell (i,j) to the cell in their left (i,j-1)
- R - they move from the current cell (i,j) to the cell in their right (i,j+1)
Input
The first line of the input contains N and M.The second line contains K(the length of the pattern).
The next line contains the pattern.
Output
Print the number of valid starting cells.Constraints
1 ≤ N, M ≤ 10000 ≤ K ≤ N*M
Sample
Input | Output |
---|---|
2 2 2 LR | 2 |