One day, Bobo was attending an international light exhibition and noticed a grid of

lights arranged in

rows and

columns. Initially, all lights were off.
Bobo noticed that there were two buttons for each row and column, one for turning on and one for turning off. This means that he can perform the following four operations:
1. row

on: turns on all the lights in row

.
2. row

off: turns off all the lights in row

.
3. column

on: turns on all the lights in column

.
4. column

off: turns off all the lights in column

.
Mischievous Bobo, of course, will not miss this opportunity. You are given

operations performed by Bobo. You need to determine the number of lights that are on after performing

operations in sequence.
输入描述:
The first line contains three positive integers
,
, and
, denoting the number of rows and columns of the lights, and the number of operations that Bobo performs.
The next
lines contain an operation each, with the form of each operation already given in the problem description.
输出描述:
Output an integer in one line, denoting the number of lights that are turned on after performing
operations in order.
示例1
输入
复制
2 2 3
row 1 on
column 2 off
row 2 on
示例2
输入
复制
3 4 4
row 1 on
column 4 on
row 3 on
column 2 off
备注:
To help with understanding, we provide graphical illustrations for the second sample test case. There are three rows of lights, each with four lights. Initially, all lights are off, as shown in the figure below.
After the first operation, the state of the lights is shown in the figure below.

After the second operation, the state of the lights is shown in the figure below.

After the third operation, the state of the lights is shown in the figure below.

After the fourth operation, the state of the lights is shown in the figure below. At this point, there are still
lights on.
