#include <bits/stdc++.h>
using namespace std;
class UnionFind {
  int no_c, *c, *s, l;
  vector<int> *v;

 public:
  UnionFind(int n, int l) {
    no_c = 0, this->l = l;
    v = new vector<int>[n + 2];
    c = new int[n + 2];
    s = new int[n + 2];
    s[0] = s[n + 1] = 0;
    for (int i = 1; i <= n; i++) {
      cin >> s[i];
      v[i].push_back(i);
      c[i] = i;
    }
    for (int i = 1; i <= n; i++) {
      if (s[i] > l) {
        no_c++;
      }
    }
    for (int i = 1; i <= n; i++) {
      Union(i - 1, i);
      Union(i, i + 1);
    }
  }
  void Union(int i, int j) {
    if (s[i] <= l || s[j] <= l || c[i] == c[j]) {
      return;
    }
    no_c--;
    int c1 = c[i];
    int c2 = c[j];
    int n1 = v[c1].size();
    int n2 = v[c2].size();
    if (n1 <= n2) {
      for (int i = 0; i < v[c1].size(); i++) {
        c[v[c1][i]] = c2;
        v[c2].push_back(v[c1][i]);
      }
      v[c1].resize(1);
    } else {
      for (int i = 0; i < v[c2].size(); i++) {
        c[v[c2][i]] = c1;
        v[c1].push_back(v[c2][i]);
      }
      v[c2].resize(1);
    }
  }
  void update(int in, int g) {
    if (s[in] <= l) {
      s[in] += g;
      if (s[in] > l) {
        no_c++;
        Union(in, in - 1);
        Union(in, in + 1);
      }
    }
  }
  int getAns() { return no_c; }
};
int main() {
  int n, m, l;
  cin >> n >> m >> l;
  UnionFind u(n, l);
  while (m--) {
    int q;
    cin >> q;
    if (!q) {
      cout << u.getAns() << "\n";
    } else {
      int in, g;
      cin >> in >> g;
      u.update(in, g);
    }
  }
}
