#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5) + 10;
int a[N];
int p[N];
int main() {
  int n, m, L;
  cin >> n >> m >> L;
  set<int> S;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    p[i] = i;
    if (a[i] > L) {
      S.insert(i);
    }
  }
  for (int i = 1; i < n; i++) {
    if (a[i] > L && a[i - 1] > L) {
      if (p[i] != p[i - 1]) {
        if (S.count(p[i])) {
          S.erase(S.find(p[i]));
        }
        p[i] = p[i - 1];
      }
    }
  }
  int cm;
  int pp, d;
  for (int i = 0; i < m; i++) {
    cin >> cm;
    if (cm == 0) {
      cout << S.size() << "\n";
    } else {
      cin >> pp >> d;
      pp--;
      long long x = a[pp];
      x += d;
      if (x > L) {
        if (a[pp] <= L) {
          S.insert(pp);
          int prev = pp - 1;
          int next = pp + 1;
          if (prev >= 0 && a[prev] > L && p[pp] != p[prev]) {
            if (S.count(p[pp])) {
              S.erase(S.find(p[pp]));
            }
            p[pp] = p[prev];
          }
          if (next < n && a[next] > L && p[pp] != p[next]) {
            if (S.count(p[next])) {
              S.erase(S.find(p[next]));
            }
            p[next] = p[pp];
          }
        }
        a[pp] = L + 1;
      } else {
        a[pp] += d;
      }
    }
  }
  return 0;
}
