#d11102. 喵~喵~喵~

喵~喵~喵~

Meow~ Meow~ Meow~

Problem Description

Little C owns nn cats numbered from 11 to nn. Little C does not like feeding just one cat at a time, so each time he feeds a contiguous range of cats [l,r][l, r], and every feeding uses a different kind of cat food. There are mm operations in total; each operation gives op,l,rop, l, r.

  • If op=1op = 1, Little C feeds the cats with indices in [l,r][l, r] once.
  • If op=2op = 2, this is a query: output the total number of different kinds of cat food eaten by the cats with indices in [l,r][l, r].

Input Format

The first line contains two integers n,mn, m.

The next mm lines each contain three integers op,l,rop, l, r.

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

0≤n,m≤1000000 \le n, m \le 100000, 1≤l≤r≤n1 \le l \le r \le n.