human
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 ≤ n, m ≤ 100 000, 1 ≤ l ≤ 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 ≤ a_i ≤ 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 ≤ p_i ≤ n, 1 ≤ d_i ≤ 10^9) — the number of the hairline and the length it grows by.

Output

For each query of type 0 print the time...
Using python3 can you solve the prior task?

=====
Give me a Python code to find the time the haircut would take?
assistant
#Here is Python code to find the time the haircut would take.

class DisjointSets:
    def __init__(self, n):
        self.parent = [-1 for x in range(n + 1)]

    def makeSet(self, node):
        self.parent[node] = node

    def find(self, node):
        parent = self.parent
        if parent[node] != node:
            parent[node] = self.find(parent[node])
        return parent[node]

    def union(self, node, other):
        self.parent[other] = node

def makeSetp(i):
    global ans, n
    if ds.parent[i] == -1:
        ds.makeSet(i)
        ans += 1

        if i <= n - 1 and ds.parent[i + 1] != -1:
            ds.union(i, i + 1)
            ans -= 1
        if i > 0 and ds.parent[i - 1] != -1:
            ds.union(i, i - 1)
            ans -= 1

ans = 0
n, m, l = map(int, input().split())
ds = DisjointSets(n)
seq = list(map(int, input().split()))
for i in range(len(seq)):
    if seq[i] > l:
        makeSetp(i)

for _ in range(m):
    x = input()
    if x == "0":
        print(ans)
    else:
        x = list(map(int, x.split()))
        i = x[1] - 1
        seq[i] += x[2]
        if seq[i] > l:
            makeSetp(i)