#include <bits/stdc++.h>
using namespace std;
long long count_set(vector<long long> hair, long long l) {
  long long ans = 0;
  for (long long i = 1; i < hair.size(); i++)
    if (hair[i] > l && hair[i - 1] <= l) ans++;
  return ans;
}
int main() {
  long long n, m, l, ans = 0;
  cin >> n >> m >> l;
  vector<long long> hair(n + 1, 0);
  for (long long i = 1; i <= n; i++) cin >> hair[i];
  ans = count_set(hair, l);
  for (long long i = 1; i <= m; i++) {
    int t;
    scanf("%d", &t);
    if (t == 0)
      cout << ans << endl;
    else {
      long long p, d;
      cin >> p >> d;
      if (hair[p] + d > l && hair[p] <= l && p == n) {
        if (hair[p - 1] <= l) {
          ans++;
        }
      } else if (hair[p] + d > l && hair[p] <= l && p == 1) {
        if (hair[p + 1] <= l) {
          ans++;
        }
      } else if (hair[p] + d > l && hair[p] <= l) {
        if (hair[p + 1] > l && hair[p - 1] > l) {
          ans--;
        } else if (hair[p + 1] <= l && hair[p - 1] <= l) {
          ans++;
        }
      }
      hair[p] += d;
    }
  }
}
