#d11102. 喵~喵~喵~
喵~喵~喵~
Meow~ Meow~ Meow~
Problem Description
Little C owns cats numbered from to . Little C does not like feeding just one cat at a time, so each time he feeds a contiguous range of cats , and every feeding uses a different kind of cat food. There are operations in total; each operation gives .
- If , Little C feeds the cats with indices in once.
- If , this is a query: output the total number of different kinds of cat food eaten by the cats with indices in .
Input Format
The first line contains two integers .
The next lines each contain three integers .
Output Format
For each query, output one line containing a single integer: the answer.
Sample Input
5 4
1 1 1
1 2 2
2 1 1
2 1 2
Sample Output
1
2
Constraints
, .