Golden Field
Given an grid where each cell is initially black, Kozak Vus can perform operations to change the color of the cells. In each operation, he can choose a row or a column and invert the color of all cells in it: turning black cells to gold and gold cells to black.
Your task is to determine the number of gold cells after all operations have been executed.
Input
The first line contains a single integer (), representing the number of rows.
The second line contains a single integer (), representing the number of columns. Note that the constraint is always satisfied.
The third line contains a single integer (), representing the number of operations.
Each of the next lines contains either the character «R
» (indicating a row operation) or «C
» (indicating a column operation), followed by an integer () for rows or () for columns, depending on the operation type.
Output
Output the total number of gold cells after all operations have been completed.
Examples
Scoring
( points): , , ;
( points): , , ;
( points): , , ;
( points): no additional constraints.