Alice's hair is growing by leaps and bounds. Maybe the cause of it is the excess of vitamins, or maybe it is some black magic...

To prevent this, Alice decided to go to the hairdresser. She wants for her hair length to be at most $l$ centimeters after haircut, where $l$ is her favorite number. Suppose, that the Alice's head is a straight line on which $n$ hairlines grow. Let's number them from $1$ to $n$. With one swing of the scissors the hairdresser can shorten all hairlines on any segment to the length $l$, given that all hairlines on that segment had length strictly greater than $l$. The hairdresser wants to complete his job as fast as possible, so he will make the least possible number of swings of scissors, since each swing of scissors takes one second.

Alice hasn't decided yet when she would go to the hairdresser, so she asked you to calculate how much time the haircut would take depending on the time she would go to the hairdresser. In particular, you need to process queries of two types:  $0$ — Alice asks how much time the haircut would take if she would go to the hairdresser now.  $1$ $p$ $d$ — $p$-th hairline grows by $d$ centimeters. 

Note, that in the request $0$ Alice is interested in hypothetical scenario of taking a haircut now, so no hairlines change their length.


-----Input-----

The first line contains three integers $n$, $m$ and $l$ ($1 \le n, m \le 100\,000$, $1 \le l \le 10^9$) — the number of hairlines, the number of requests and the favorite number of Alice.

The second line contains $n$ integers $a_i$ ($1 \le a_i \le 10^9$) — the initial lengths of all hairlines of Alice.

Each of the following $m$ lines contains a request in the format described in the statement.

The request description starts with an integer $t_i$. If $t_i = 0$, then you need to find the time the haircut would take. Otherwise, $t_i = 1$ and in this moment one hairline grows. The rest of the line than contains two more integers: $p_i$ and $d_i$ ($1 \le p_i \le n$, $1 \le d_i \le 10^9$) — the number of the hairline and the length it grows by.


-----Output-----

For each query of type $0$ print the time the haircut would take.


-----Example-----
Input
4 7 3
1 2 3 4
0
1 2 3
0
1 1 3
0
1 3 1
0

Output
1
2
2
1



-----Note-----

Consider the first example:  Initially lengths of hairlines are equal to $1, 2, 3, 4$ and only $4$-th hairline is longer $l=3$, and hairdresser can cut it in $1$ second.  Then Alice's second hairline grows, the lengths of hairlines are now equal to $1, 5, 3, 4$  Now haircut takes two seonds: two swings are required: for the $4$-th hairline and for the $2$-nd.  Then Alice's first hairline grows, the lengths of hairlines are now equal to $4, 5, 3, 4$  The haircut still takes two seconds: with one swing hairdresser can cut $4$-th hairline and with one more swing cut the segment from $1$-st to $2$-nd hairline.  Then Alice's third hairline grows, the lengths of hairlines are now equal to $4, 5, 4, 4$  Now haircut takes only one second: with one swing it is possible to cut the segment from $1$-st hairline to the $4$-th.

Difficulty: interview

Starter code:

Solutions:
# -*- coding: utf-8 -*-

import math
import collections
import bisect
import heapq
import time
import itertools
import sys

"""
created by shhuan at 2018/11/10 22:33

"""


N, M, L = list(map(int, input().split()))
A = [int(x) for x in input().split()]

ans = 0

i = 0
while i < N:
    j = i
    while j < N and A[j] > L:
        j += 1
    if j > i:
        ans += 1
        i = j + 1
    else:
        i += 1


for mi in range(M):
    line = input()
    if len(line) == 1:
        print(ans)
    else:
        t, p, d = list(map(int, line.split()))
        prev = A[p-1]
        A[p-1] += d
        if prev <= L < A[p-1]:
            if p-2 >= 0 and p < N:
                if A[p-2] > L and A[p] > L:
                    ans -= 1
                elif A[p-2] <= L and A[p] <= L:
                    ans += 1
                else:
                    pass
            elif p-2 >= 0:
                if A[p-2] > L:
                    pass
                else:
                    ans += 1
            elif p < N:
                if A[p] > L:
                    pass
                else:
                    ans += 1
            else:
                ans += 1


n,m,l = list(map(int,input().split()))


res = []
tim =0
a=list(map(int,input().split()))
i=0

while(i<n):
    while(i<n and a[i] <= l):
        i +=1
    if(i == n):
        break
    tim += 1
    while(i < n and a[i] > l):
        i+=1

for i in range(m):
    s = input()
    if(s=='0'):
        res.append(str(tim))
        continue
    w,p,d = list(map(int,s.split()))
    
    p-=1
    
    if(a[p] > l):
        continue
    a[p] += d
    if(a[p] <= l):
        continue
    if(p > 0 and a[p-1] > l and p < n-1 and a[p+1] > l):
        tim -= 1
    elif((p > 0 and a[p-1] > l) or (p < n-1 and a[p+1] > l)):
        continue
    else:
        tim += 1
s = '\n'.join(res)

print(s)    


n,m,l = list(map(int,input().split()))
a = input().split()
b = [0]*n
for i in range(n):
    b[i] = int(a[i])
count = 0
for i in range(n):
    if b[i] > l:
        count += 1
        if i > 0:
            if b[i-1] > l:
                count -= 1
for i in range(m):
    t = input().split()
    if int(t[0]) == 0:
        print(count)
    else:
        p = int(t[1])
        d = int(t[2])
        if b[p-1] <= l:
            b[p-1] += d
            if b[p-1] > l:
                if n == 1:
                    count += 1
                else:
                    if p-1 > 0 and p-1 < n-1:
                        if b[p-2] > l and b[p] > l:
                            count -= 1
                        elif b[p-2] <= l and b[p] <= l:
                            count += 1
                    elif p-1 == n-1:
                        if b[p-2] <= l:
                            count += 1
                    else:
                        if b[p] <= l:
                            count += 1


n,m,l = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

anss = []
ans = 0
on = False
for i in range(n):
    if a[i] > l and not on:
        ans += 1
        on = True
    elif a[i] <= l and on:
        on = False

for i in range(m):
    r = [int(s) for s in input().split()]
    if r[0] == 0:
        anss.append(ans)
    else:
        p,d = r[1]-1,r[2]
        if a[p] <= l and a[p]+d > l:
            add = 1
            if p > 0 and a[p-1] > l:
                add -= 1
            if p < n-1 and a[p+1] > l:
                add -= 1
            ans += add
        a[p] += d
    # print(a)

print(*anss, sep='\n')

gcd = lambda a, b: gcd(b, a % b) if b else a


def main():
    n, m, l = list(map(int, input().split()))
    arr = list(map(int, input().split()))
    brr = [i > l for i in arr]
    total = 0
    for i in range(len(brr)):
        if brr[i] and (not i or not brr[i - 1]):
            total += 1
    for i in range(m):
        s = input()
        if s[0] == '0':
            print(total)
        else:
            _, a, b = list(map(int, s.split()))
            a -= 1
            arr[a] += b
            if arr[a] > l and not brr[a]:
                brr[a] = True
                if (a > 0 and brr[a - 1]) and (a < len(brr) - 1 and brr[a + 1]):
                    total -= 1
                elif (a == 0 or (a > 0 and not brr[a - 1])) and (a == len(brr) - 1 or (a < len(brr) - 1 and not brr[a + 1])):
                    total += 1




main()


import sys

nbmeches, nbreq, l = list(map(int, sys.stdin.readline().split()))
meches = list(map(int, sys.stdin.readline().split()))
trop_grand = [False]*nbmeches
pont = 0
for i in range(nbmeches):
    if meches[i] > l:
        trop_grand[i] = True
        if i == 0 or (trop_grand[i-1] is False):
            pont += 1

for i in range(nbreq):
    req = sys.stdin.readline().split()
    if int(req[0]) == 0:
        print(pont)
    else:
        meches[int(req[1])-1] += int(req[2])
        #print(meches)
        if meches[int(req[1])-1] > l and not trop_grand[int(req[1])-1]:
            trop_grand[int(req[1])-1] = True
            if nbmeches == 1:
                pont = 1
            else:
                if int(req[1])-1 == 0 and not trop_grand[int(req[1])]:
                    pont += 1
                elif (not int(req[1])-1 == 0) and int(req[1])-1 == nbmeches-1 and not trop_grand[int(req[1])-2]:
                    pont += 1
                elif (not int(req[1])-1 == 0) and (not int(req[1])-1 == nbmeches-1) and trop_grand[int(req[1])] and trop_grand[int(req[1])-2]:
                    pont = max(0, pont-1)
                elif (not int(req[1])-1 == 0) and (not int(req[1])-1 == nbmeches-1) and (not trop_grand[int(req[1])]) and (not trop_grand[int(req[1])-2]):
                    pont += 1
        #print(trop_grand)


#!/usr/bin/env python3
import sys

def rint():
    return list(map(int, sys.stdin.readline().split()))
#lines = stdin.readlines()

n, m, l = rint()
a = list(rint())

seg_cnt = 0
for i in range(1,n):
    if a[i-1] > l and a[i] <= l:
        seg_cnt +=1
if a[n-1] > l:
    seg_cnt += 1


for i in range(m):
    t = list(rint())
    if t[0] == 0:
        print(seg_cnt)
    else:
        p = t[1] - 1
        d = t[2]
        if a[p] + d > l and a[p] <= l:
            if p == 0:
                if a[(p+1)%n] <= l:
                    seg_cnt += 1
            elif p == n-1:
                if a[p-1] <= l:
                    seg_cnt += 1
            else:
                if a[p-1] > l and a[(p+1)%n] > l:
                    seg_cnt -= 1
                elif a[p-1] <= l and a[(p+1)%n] <= l:
                    seg_cnt += 1
        a[p] += d


n, q, k = list(map(int, input().split(' ')))

a = list(map(int, input().split(' ')))

count = 0

def verify(x):
  if(x < 0) or (x >= n):
    return False

  return (a[x] > k)

for i in range(n):
  if verify(i):
    count += 1

    if verify(i - 1):
      count -= 1

def cut(i):
  if not verify(i):
    return 0

  result = 1

  if verify(i - 1):
    result -= 1
  
  if verify(i + 1):
    result -= 1

  return result

for i in range(q):
  line = input()
  if(line == '0'):
    print(count)
  else:
    _, x, y = list(map(int, line.split(' ')))
    x -= 1

    if not verify(x):
      a[x] += y
      count += cut(x)
    else:
      a[x] += y



n, m, l = list(map(int,input().split()))
a = list(map(int,input().split()))
b = []
for i in a:
    if i>l:
        b.append(1)
    else:
        b.append(0)
ans = 0
i = 0
while i < n:
    if b[i]:
        ans += 1
        while i < n and b[i]:
            i+=1
    i+=1
for i in range(m):
    s = input()
    if s[0] == '0':
        print(ans)
    else:
        t,p,d = list(map(int,s.split()))
        if a[p-1]<=l:
            a[p-1] += d
            if a[p-1] > l:
                b[p-1] = 1
                if p-2>=0 and b[p-2] and p<=n-1 and b[p]:
                    ans -= 1
                elif p-2>=0 and b[p-2] or p <=n-1 and b[p]:
                    ans += 0
                else:
                    ans += 1



n, m, l = list(map(int, input().split()))

a = list(map(int, input().split()))

cuts = 0
prev = False
for i in range(n):
    if a[i] > l:
        if prev:
            continue
        else:
            cuts += 1
            prev = True
    else:
        prev = False

for _ in range(m):
    s = input()
    if s.startswith('0'):
        print(cuts)
    else:
        p, d = list(map(int, s[1:].split()))
        p -= 1
        if a[p] <= l and a[p] + d > l:
            t = (p - 1 in range(n) and a[p - 1] > l) + \
                (p + 1 in range(n) and a[p + 1] > l)
            if t == 0:
                cuts += 1
            elif t == 1:
                pass
            else:
                cuts -= 1
        a[p] += d

'''

4 7 3
4 2 3 1
0
1 2 3
0
1 1 3
0
1 3 1
0


'''


3


def readint():
    return int(input())


def readline():
    return [int(c) for c in input().split()]


def compute_time(a, l):
    cnt = 0
    prev = -1
    for e in a:
        if e > l and prev <= l:
            cnt += 1
        prev = e
        
    return cnt

def main():
    n, m, l = readline()
    a = readline()

    time = compute_time(a, l)

    for i in range(m):
        q = readline()
        if q[0] == 0:
            print(time)
        else:
            p, d = q[1], q[2]
            is_left_short = True if p == 1 or a[p-2] <= l else False
            is_right_short = True if p == n or a[p] <= l else False
            if is_left_short and is_right_short and a[p-1] <= l and a[p-1] + d > l:
                time += 1
            elif (not is_left_short) and (not is_right_short) and a[p-1] <= l and a[p-1] + d > l:
                time -= 1

            a[p-1] += d

            

def __starting_point():
    main()

__starting_point()

n, m, l = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

def time_to_cut():
    nonlocal a
    t = 0
    pr = 0
    for i in range(n):
        if a[i] <= l:
            pr = 0
        elif pr == 0:
            t += 1
            pr = 1
    return(t)

def update_time(p, d):
    nonlocal a
    nonlocal T
    p -= 1
    pos = (0 if a[p] <= l else 1)
    a[p] += d
    pns = (0 if a[p] <= l else 1)
    sa = bool(pns - pos)
    if not sa:
        pass
    elif n == 1:
        T += 1
    elif p == 0:
        if a[p+1] <= l:
            T += 1
    elif p == n-1:
        if a[p-1] <= l:
            T += 1
    elif a[p+1] <= l and a[p-1] <= l:
        T += 1
    elif a[p+1] > l and a[p-1] > l:
        T -= 1
    return

T = time_to_cut()

for i in range(m):
    r = [int(x) for x in input().split()]
    if len(r) == 1: # time request
        print(T)
    else: # hair grow
        update_time(r[1], r[2])


n,m,l=list(map(int,input().split()))
a=list(map(int,input().split()))
c=0
if a[0]>l:
    c+=1
    a[0]=0
for i in range(1,n):
    if a[i]>l:
        a[i]=0
        if a[i-1]!=0:
            c+=1
for i in range(m):
    s=input()
    if s[0]=='0':
        print(c)
    else:
        _,x,y=list(map(int,s.split()))
        if a[x-1]<=l and a[x-1]!=0:
            if a[x-1]+y>l:
                if x!=1 and x!=n and a[x-2]!=0 and a[x]!=0:
                    c+=1
                    a[x-1]=0
                elif x==1 and n!=1 and a[x]!=0:
                    a[x-1]=0
                    c+=1
                elif x==n and n!=1 and a[x-2]!=0:
                    a[x-1]=0
                    c+=1
                elif x!=1 and x!=n and a[x-2]==0 and a[x]==0:
                    c-=1
                    a[x-1]=0
                elif n==1:
                    if c==0:
                        c=1
                else:
                    a[x-1]=0
            else:
                a[x-1]+=y


n, q, l = list(map(int, input().split()))
a = [0] + list(map(int, input().split())) + [0]
t = 0
s = [False] * (n + 2)
for i in range(1, n + 1):
    if a[i] > l:
        if s[i - 1] == False:
            t += 1
        s[i] = True

for i in range(q):
    k = input()
    if k[0] == '0':
        print(t)
    else:
        k, p, d = list(map(int, k.split()))
        a[p] += d
        if a[p] > l and s[p] == False:
            if s[p - 1] and s[p + 1]:
                t -= 1
            else:
                if s[p - 1] == False and s[p + 1] == False:
                    t += 1
                else:
                    pass
            s[p] = True
   
        
        


#!/usr/bin/env python3
import sys


def count_it():
    return len(''.join(list([' ' if x <= l else '1' for x in h])).split())


n, m, l = list([int(x) for x in sys.stdin.readline().split(' ')])
h = list([int(x) for x in sys.stdin.readline().split(' ')])
k = count_it()
for mi in range(m):
    request = sys.stdin.readline().split(' ')
    if len(request) == 1:
        print(k)
    else:
        r, p, d = list([int(x) for x in request])
        h[p - 1] += d
        if (h[p - 1] > l) and (h[p - 1] - d <= l):
            if n == 1:
                k += 1
            else:
                if (p - 1 == 0 and h[1] <= l) or (p == len(h) and h[p - 2] <= l) or (h[p - 2] <= l and h[p] <= l):
                    k += 1
                elif p - 1 != 0 and p != len(h) and h[p - 2] > l and h[p] > l:
                    k -= 1


import sys
input = sys.stdin.readline

def main():
    n, m, l = map(int, input().split())
    a = list(map(int, input().split()))
    d = {}
    used = set()
    current = 0
    for i in range(n):
        if a[i] > l:
            if i in used:
                continue
            elif (i - 1) not in used and (i + 1) not in used:
                current += 1
            elif (i - 1) in used and (i + 1) in used and (s[1] - 1) not in used:
                current -= 1
            used.add(i)
        d[i] = a[i]
    for i in range(m):
        s = list(map(int, input().split()))
        if s[0] == 0:
            print(current)
        elif s[0] == 1:
            d[s[1] - 1] += s[2]
            if d[s[1] - 1] > l:
                if (s[1] - 1) in used:
                    continue
                elif (s[1] - 2) not in used and (s[1]) not in used:
                    current += 1
                elif (s[1] - 2) in used and (s[1]) in used and (s[1] - 1):
                    current -= 1
                used.add(s[1] - 1)
                
def __starting_point():
    main()
__starting_point()

from bisect import bisect_right as br
from bisect import bisect_left as bl
import sys
MAX = sys.maxsize
MAXN = 10**6+10
def isprime(n):
    n = abs(int(n))
    if n < 2:
        return False
    if n == 2: 
        return True    
    if not n & 1: 
        return False
    for x in range(3, int(n**0.5) + 1, 2):
        if n % x == 0:
            return False
    return True

def mhd(a,b,x,y):
    return abs(a-x)+abs(b-y)

def numIN():
    return(map(int,sys.stdin.readline().strip().split()))

def charIN():
    return(sys.stdin.readline().strip().split())


def ans(a,l,n):
	f = 0
	cnt = 0
	for i in range(n):
		if a[i]>l:
			if not f:
				cnt+=1
				f = 1
		else:
			f = 0
	return cnt


n,m,l = numIN()
a = list(numIN())
cnt = ans(a,l,n)
fl = [0]*(n+1)
for i in range(n):
	if a[i]>l:
		fl[i]=1
for _ in range(m):
	x = list(numIN())
	if len(x)==1:
		print(cnt)
	else:
		p = x[1]-1
		d = x[2]
		a[p]+=d
		if a[p]>l:
			if not fl[p]:
				if p==0:
					if not fl[p+1]:
						cnt+=1
				elif p==n-1:
					if not fl[p-1]:
						cnt+=1
				else:
					if fl[p+1] and fl[p-1]:
						cnt-=1
					elif not (fl[p+1] or fl[p-1]):
						cnt+=1
			fl[p] = 1

def CuttingTime(hairline_len,l,time,p,d):
    n = len(list(hairline_len.keys()))
    if hairline_len[p] <= l:
        hairline_len[p] += d
        if p == 1:
            if n > 1: 
                if hairline_len[p+1] <= l and hairline_len[p] > l:
                    time += 1
            else:
                if hairline_len[p]-d <= l:
                    time += 1
        elif 1 < p < n:
            if hairline_len[p] > l:
                if hairline_len[p-1] <= l and hairline_len[p+1] <= l:
                    time += 1
                elif hairline_len[p-1] > l and hairline_len[p+1] > l and time > 1:
                    time -= 1
        else:
            if hairline_len[p-1] <= l and hairline_len[p] > l:
                time += 1
    
    return time

def InitialTIme(hairline_len,l):
    time = 0
    count = 0

    for i in hairline_len:
        if hairline_len[i] > l:
            count += 1
        else:
            if count > 0:
                time += 1
            count = 0
    
    if count > 0:
        time += 1

    return time

def AliceHairDresser():
    inputs = list(map(int,input().split()))
    n = inputs[0]
    m = inputs[1]
    l = inputs[2]

    lengths = list(map(int,input().split()))
    hairline_len = {}

    for i in range(1,n+1):
        hairline_len[i] = lengths[i-1]
    
    time = InitialTIme(hairline_len,l)
    #print time

    for i in range(m):
        query = input()

        if len(query) == 1:
            print (time)
        else:
            inputs1 = list(map(int,query.split()))
            #print inputs1
            p = inputs1[1]
            d = inputs1[2]
            if hairline_len[p] <= l:
                time = CuttingTime(hairline_len,l,time,p,d)
        
AliceHairDresser()


def inint():
    return int(input())
def inlist():
    return list(map(int,input().split()))

def main():
    n,m,l=inlist()
    aa=inlist()
    chg=0;ch=0
    a=[[i,0] for i in aa]
    for i in range(n):
        if aa[i]>l :
            if ch==0:
                ch+=1
                chg+=1
                a[i][1]=chg
            else:
                ch+=1
                a[i][1]=chg
        else:
            if ch!=0:ch=0
    sol=list()
    if n>1:
        for z in range(m):
            qu=input()
            if qu=="0":sol.append(chg)
            else:
                #print(chg)
                zz,p,d=list(map(int,qu.split()))
                p-=1
                a[p][0]+=d
                if a[p][1]==0 and a[p][0]>l:
                    if p>0 and p<n-1:
                        #print('first')
                        if a[p-1][1]==0 and a[p+1][1]==0:
                            chg+=1
                            a[p][1]=chg
                        elif a[p-1][1]==0 and a[p+1][1]>0:
                            a[p][1]=a[p+1][1]
                        elif a[p-1][1]>0 and a[p+1][1]==0:
                            a[p][1]=a[p-1][1]
                        else:
                            a[p][1]=a[p-1][1];chg-=1
                    elif p==0:
                        #print('second')
                        if a[p+1][1]==0:
                            chg+=1
                            a[p][1]=chg
                        else:
                            a[p][1]=a[p+1][1]
                    elif p==n-1:
                        #print('third')
                        if a[p-1][1]==0:
                            chg+=1
                            a[p][1]=chg
                        else:
                            a[p][1]=a[p-1][1]
    else:
        for z in range(m):
            qu=input()
            if qu=="0":sol.append(chg)
            else:
                #print(chg)
                zz,p,d=list(map(int,qu.split()))
                p-=1
                a[p][0]+=d
                if a[p][0]>d:chg=1
    #print(a,chg)
    print(*sol,sep='\n')





def __starting_point():
    #import profile
    #profile.run("main()")
    main()
__starting_point()

n, m, l = list(map(int, input().split()))
l += 1
hair = [1] * (n + 1)
other_end = [1] * (n + 1)
i = 1
j = 1
big = 1
res = 1
for a in map(int, input().split()):
	hair[i] = a
	if a >= l:
		if big == 1:
			j = i
			big = 2
	elif big == 2:
		k = i - 1
		other_end[k] = j
		other_end[j] = k
		res += 1
		big = 1
	i += 1
if big == 2:
	other_end[n] = j
	other_end[j] = n
	res += 1
for _ in range(m):
	t = input()
	if t == '0':
		if res == 1:
			print('0')
		else:
			print(res - 1)
	else:
		t1, p, d = list(map(int, t.split()))
		old = hair[p]
		hair[p] += d
		if hair[p] >= l > old:
			if p == 1 or hair[p - 1] < l:
				case_id = 1
			else:
				case_id = 2
			if p != n and hair[p + 1] >= l:
				case_id += 2
			if case_id == 1:
				other_end[p] = p
				res += 1
			elif case_id == 2:
				other_end[p] = other_end[p - 1]
				other_end[other_end[p]] = p
			elif case_id == 3:
				other_end[p] = other_end[p + 1]
				other_end[other_end[p]] = p
			else:
				left_end = other_end[p - 1]
				right_end = other_end[p + 1]
				other_end[left_end] = right_end
				other_end[right_end] = left_end
				res -= 1


n,m,l = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

anss = []
ans = 0
on = False
for i in range(n):
    if a[i] > l and not on:
        ans += 1
        on = True
    elif a[i] <= l and on:
        on = False

for i in range(m):
    r = [int(s) for s in input().split()]
    if r[0] == 0:
        anss.append(ans)
    else:
        p,d = r[1]-1,r[2]
        if a[p] <= l and a[p]+d > l:
            add = 1
            if p > 0 and a[p-1] > l:
                add -= 1
            if p < n-1 and a[p+1] > l:
                add -= 1
            ans += add
        a[p] += d
    # print(a)

print(*anss, sep='\n')

(n, m, length_) = [int(s) for s in input().split(" ")]

a = [int(s) for s in input().split(" ")]

result = 0
prev = None
for i in range(n):
    if prev and prev <= (length_):
        if a[i] > length_:
            result+=1
    if not prev and a[i] > length_:
        result+=1

    prev = a[i]


for i in range(m):
    temp = input()
    if temp == "0":
        print(result)
    else:
        (_, p, d) = [int(s) for s in temp.split(" ")]
        num = p - 1
        cm = d
        old_val = a[num]
        a[num] += cm
        if old_val > length_:
            continue
        if a[num] <= length_:
            continue

        if num!=0 and num!=(n-1):
            if a[num-1] > length_ and a[num+1] > length_:
                result-=1
            elif a[num-1] <= length_ and a[num+1] <= length_:
                result += 1
        elif num == 0 and (len(a)==1 or a[1] <= length_):
            result+=1
        elif num == (n-1) and a[n-2] <= length_:
            result+=1




# easy = True
# for el in a:
#     if el <= length_:
#         easy = False
#
# t = [0]*4*n
#
# def build (a, v, tl, tr):
#     if tl == tr:
#         t[v] = 1 if a[tl] > length_ else 0
#     else:
#         tm = (tl + tr) // 2
#         build (a, v*2, tl, tm)
#         build (a, v*2+1, tm+1, tr)
#         if a[tm] > length_ and a[tm + 1] > length_:
#             t[v] = t[v * 2] + t[v * 2 + 1] -1
#         else:
#             t[v] = t[v * 2] + t[v * 2 + 1]
#
#
#
#
# def update (v, tl, tr, pos):
#     if (tl == tr):
#         if tl == pos:
#             # print(v, tl, pos)
#             t[v] = 1
#     else:
#         tm = (tl + tr) // 2
#         if (pos <= tm):
#             update(v*2, tl, tm, pos)
#         else:
#             update(v*2+1, tm+1, tr, pos)
#         if a[tm] > length_ and a[tm + 1] > length_:
#             t[v] = t[v * 2] + t[v * 2 + 1] - 1
#         else:
#             t[v] = t[v * 2] + t[v * 2 + 1]
#
# if not easy:
#     build(a,1,0,n-1)
# # print(t)
#
# # def evaluate(v, tl, tr, l, r):
# #     if (l > r):
# #         return 0
# #     if (l == tl and r == tr):
# #         return 1 if t[v] > length_ else 0
# #         tm = (tl + tr) // 2
# #     left_result =  evaluate(v*2, tl, tm, l, min(r,tm))
# #     right_result = evaluate(v*2+1, tm+1, tr, max(l,tm+1), r)
# #     if t[tm] > length_ and t[tm+1] > length_:
# #         return left_result + right_result -1
# #     else:
# #         return left_result + right_result
#
# for i in range(m):
#     temp = input()
#     if temp == "0":
#         if easy:
#             print(1)
#         else:
#             print(t[1])
#     else:
#         if easy:
#             continue
#
#         (_, p, d) = [int(s) for s in temp.split(" ")]
#         # print("sss", p, d)
#         num = p - 1
#         cm = d
#         old_val = a[num]
#         a[num] += cm
#         if old_val > length_:
#             continue
#         if a[num] <= length_:
#             continue
#         update(1, 0, n - 1, num)


n, m, l = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

def time_to_cut():
    nonlocal a
    t = 0
    pr = 0
    for i in range(n):
        if a[i] <= l:
            pr = 0
        elif pr == 0:
            t += 1
            pr = 1
    return t

def update_time(p, d):
    nonlocal a
    nonlocal T
    p -= 1
    pos = (0 if a[p] <= l else 1)
    a[p] += d
    pns = (0 if a[p] <= l else 1)
    sa = bool(pns - pos)
    if not sa:
        pass
    elif n == 1:
        T += 1
    elif p == 0:
        if a[p+1] <= l:
            T += 1
    elif p == n-1:
        if a[p-1] <= l:
            T += 1
    elif a[p+1] <= l and a[p-1] <= l:
        T += 1
    elif a[p+1] > l and a[p-1] > l:
        T -= 1
    return

T = time_to_cut()

for i in range(m):
    r = [int(x) for x in input().split()]
    if r[0] == 0: # time request
        print(T)
    else: # hair grow
        update_time(r[1], r[2])