— I... I survived.

— Welcome home, Chtholly.

— I kept my promise...

— I made it... I really made it!

After several days of fighting, Chtholly Nota Seniorious miraculously returned from the fierce battle.

As promised, Willem is now baking butter cake for her.

However, although Willem is skilled in making dessert, he rarely bakes butter cake.

This time, Willem made a big mistake — he accidentally broke the oven!

Fortunately, Chtholly decided to help him.

Willem puts *n* cakes on a roll, cakes are numbered from 1 to *n*, the *i*-th cake needs *a*<sub class="lower-index">*i*</sub> seconds of baking.

Willem needs Chtholly to do *m* operations to bake the cakes.

Operation 1: 1 *l* *r* *x*

Willem asks Chtholly to check each cake in the range [*l*, *r*], if the cake needs to be baked for more than *x* seconds, he would bake it for *x* seconds and put it back in its place. More precisely, for every *i* in range [*l*, *r*], if *a*<sub class="lower-index">*i*</sub> is strictly more than *x*, *a*<sub class="lower-index">*i*</sub> becomes equal *a*<sub class="lower-index">*i*</sub> - *x*.

Operation 2: 2 *l* *r* *x*

Willem asks Chtholly to count the number of cakes in the range [*l*, *r*] that needs to be cooked for exactly *x* seconds. More formally you should find number of such *i* in range [*l*, *r*], that *a*<sub class="lower-index">*i*</sub> = *x*.
The first line contains two integers *n* and *m* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>).

The second line contains *n* integers, *i*-th of them is *a*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>).

The next *m* lines are the *m* operations described above. It is guaranteed that 1 ≤ *l* ≤ *r* ≤ *n* and 1 ≤ *x* ≤ 10<sup class="upper-index">5</sup>.
none
n, m = map(int, input().split())
mas = list(map(int, input().split()))
mp = []
f1 = 0
while f1 != m:
    t, l, r, x = map(int, input().split())
    two = mas[l-1: r ]
    f2 = 0
    if t == 1:
        while f2 != r - l + 1:
            if two[f2] > x:
                two[f2] -= x
            f2 += 1
        mas[l-1: r] = two
    else:
        k = 0 
        while f2 != r - l + 1:
            if two[f2] == x:
                k += 1
            f2 += 1
        mp.append(k)
    f1 += 1
mp = map(str, mp)
print("\n".join(mp))