#include <bits/stdc++.h>
using namespace std;
int n, m, t[200001], p[200001], h[200001], w[200001], ms[200001], tx[1 << 19],
    ty[1 << 19], sx[1 << 19], sy[1 << 19];
vector<int> v;
void ustaw(int *t, int *tz, int a, int x, int f) {
  a += 1 << 18;
  t[a] = x;
  tz[a] = f;
  a >>= 1;
  while (a) {
    t[a] = max(t[a + a], t[a + a + 1]);
    tz[a] = tz[a + a] + tz[a + a + 1];
    a >>= 1;
  }
}
int maks(int *t, int a, int b) {
  a += (1 << 18) - 1;
  b += (1 << 18) + 1;
  int ret = 0;
  while (a + 1 < b) {
    if (a % 2 == 0 && ret < t[a + 1]) ret = t[a + 1];
    if (b % 2 == 1 && ret < t[b - 1]) ret = t[b - 1];
    a >>= 1;
    b >>= 1;
  }
  return ret;
}
int suma(int *t, int a, int b) {
  a += (1 << 18) - 1;
  b += (1 << 18) + 1;
  int ret = 0;
  while (a + 1 < b) {
    if (a % 2 == 0) ret += t[a + 1];
    if (b % 2 == 1) ret += t[b - 1];
    a >>= 1;
    b >>= 1;
  }
  return ret;
}
int find_min(int *t, int ktory) {
  if (t[1] < ktory) return -1;
  int nr = 1;
  while (nr < (1 << 18)) {
    nr <<= 1;
    if (t[nr] < ktory) ktory -= t[nr++];
  }
  return nr - (1 << 18);
}
int main() {
  scanf("%d%d", &n, &m) ?: 0;
  for (int i = (1); i <= (m); ++i) {
    scanf("%d", &t[i]) ?: 0;
    if (t[i] == 1)
      scanf("%d%d", &p[i], &h[i]) ?: 0, h[i] -= i, v.push_back(h[i]);
    else
      scanf("%d", &p[i]) ?: 0;
  }
  sort((v).begin(), (v).end());
  for (int i = (1); i <= (m); ++i)
    if (t[i] == 1) {
      h[i] = lower_bound((v).begin(), (v).end(), h[i]) - v.begin() + 1;
      w[p[i]] = h[i];
      ms[h[i]] = p[i];
    }
  v.clear();
  for (int i = (1); i <= (m); ++i) {
    if (t[i] == 1) {
      while (true) {
        int y = find_min(sy, v.size() + 1);
        if (y == -1 || h[i] < y) break;
        v.push_back(y);
      }
      for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
        ustaw(tx, sx, ms[*it], 0, 0);
      int wn = maks(tx, p[i] + 1, n) + 1;
      ustaw(tx, sx, p[i], wn, 1);
      ustaw(ty, sy, h[i], wn, 1);
      reverse((v).begin(), (v).end());
      for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it) {
        wn = maks(tx, ms[*it] + 1, n) + 1;
        ustaw(tx, sx, ms[*it], wn, 1);
        ustaw(ty, sy, *it, wn, 1);
      }
    } else {
      for (int j = 0; j < (p[i]); ++j) {
        int x = find_min(sx, v.size() + 1);
        v.push_back(x);
      }
      for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
        ustaw(ty, sy, w[*it], 0, 0);
      ustaw(tx, sx, v.back(), 0, 0);
      v.pop_back();
      reverse((v).begin(), (v).end());
      for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it) {
        int wn = maks(ty, w[*it] + 1, n) + 1;
        ustaw(tx, sx, *it, wn, 1);
        ustaw(ty, sy, w[*it], wn, 1);
      }
    }
    int ans = maks(tx, 1, n);
    printf("%d\n", ans);
    v.clear();
  }
}
