#C2881. Chapter Read Operations
Chapter Read Operations
Chapter Read Operations
You are given a book with \(m\) chapters, initially all marked as unread. You will be given \(p\) operations. Each operation is either:
- READ x: Toggle the read status of chapter \(x\) (if it is unread, mark it as read; if it is read, mark it as unread).
- UNREADALL: Mark all chapters as unread.
After each operation, output the total number of chapters currently marked as read.
Note: Chapters are numbered from 1 to \(m\).
inputFormat
The first line contains two integers \(m\) and \(p\) separated by space, where \(m\) is the number of chapters and \(p\) is the number of operations.
The following \(p\) lines each contain one operation in one of the two formats:
READ x
UNREADALL
outputFormat
For each operation, output a line containing a single integer, the total number of chapters marked as read after that operation.
## sample4 5
READ 3
READ 1
READ 3
UNREADALL
READ 2
1
2
1
0
1
</p>