#include <bits/stdc++.h>
using namespace std;
int n, m, l;
long long int vet[100010], cont;
long long int st[40 * 100010];
inline long long int buildtree(int p, int i, int j) {
  if (i == j) {
    if (vet[i] > l)
      st[p] = 1;
    else
      st[p] = 0;
    return st[p];
  }
  int meio = (i + j) / 2;
  long long int p1 = buildtree(p * 2, i, meio);
  long long int p2 = buildtree(p * 2 + 1, meio + 1, j);
  long long int r = p1 + p2;
  if (vet[meio] > l and vet[meio + 1] > l) r--;
  return st[p] = r;
}
inline long long int update(int p, int i, int j, int pos, int val) {
  if (i > pos or j < pos) {
    return st[p];
  }
  if (i == j) {
    vet[i] += val;
    if (vet[i] > l)
      st[p] = 1;
    else
      st[p] = 0;
    return st[p];
  }
  int meio = (i + j) / 2;
  long long int p1 = update(p * 2, i, meio, pos, val);
  long long int p2 = update(p * 2 + 1, meio + 1, j, pos, val);
  long long int r = p1 + p2;
  if (vet[meio] > l and vet[meio + 1] > l) r--;
  return st[p] = r;
}
int main() {
  cin >> n >> m >> l;
  cont = 1;
  for (int i = 1; i <= n; i++) {
    cin >> vet[i];
  }
  buildtree(1, 1, n);
  while (m--) {
    int t;
    cin >> t;
    if (t == 0)
      cout << st[1] << endl;
    else {
      int p, d;
      cin >> p >> d;
      update(1, 1, n, p, d);
    }
  }
}
