Linear network
A linear network of computers was installed in the big data center. All computers are numbered with integers sequentially from to . There is a direct communication between computers with neighbouring numbers. It is clear that in such a network it is possible to directly or indirectly exchange data between any two computers. However, due to the intensity of the operations, some computers sometimes fail. In such cases, the communication between some computers is interrupted and data transfer becomes impossible.
You are asked to find out the number of groups in the network at the moment. A group is the maximum number of active computers where any two computers from the same group have communication with each other. Also, a group can consist of only one computer.
You need to answer queries. In each of the queries, either the number of the computer that has just failed is given, or it is necessary to count the number of groups.
For a better understanding of the problem, below is an explanation for the example.
Input
The first line contains two integers and . The following lines contain queries.
Each query starts with a number indicating the type of request. is always followed by the number of the failed computer.
Output
For each query of the -nd type, it is necessary to print the number of groups in the network at the current moment in a separate line.
Examples
— Initial state of the network. The number of groups is .
— The state of the network after the failure of the computer number . Number of groups — .
— The state of the network after the failure of the computer number . Number of groups — .
— The state of the network after the failure of the computer number . Number of groups — .
The requests for computer failure may be repeated.