#include <bits/stdc++.h>
using namespace std;
const int maxn = 200025, N = 1 << 19, bas = 1 << 18;
priority_queue<int, vector<int>, greater<int> > hp;
int V1[N], V2[N], n, m, i, j, opt, u, v, res;
void upd(int *v, int x, int y) {
  for (x += bas - 1, v[x] = y; x > 1; x >>= 1) v[x >> 1] = max(v[x], v[x ^ 1]);
}
int cal(int *v, int x) {
  int y = 0;
  for (x += bas - 1; x; x >>= 1)
    if (~x & 1) y = max(y, v[x ^ 1]);
  return y;
}
int who[maxn], wht[maxn], s[maxn];
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &opt, &u);
    if (opt == 1) {
      scanf("%d", &v);
      v += m - i;
      who[v] = u;
      wht[u] = v;
      hp.push(u);
      for (j = m - i + 1; j < v; j++)
        if (who[j]) upd(V1, who[j], 0);
      for (j = v; j >= m - i; j--)
        if (who[j]) {
          res = cal(V1, who[j]) + 1;
          upd(V1, who[j], res);
          upd(V2, j, res);
        }
    } else {
      for (j = 1; j < u; j++) {
        s[j] = hp.top(), hp.pop();
        upd(V2, wht[s[j]], 0);
      }
      v = hp.top(), hp.pop();
      upd(V1, v, 0);
      upd(V2, wht[v], 0);
      who[wht[v]] = 0;
      wht[v] = 0;
      for (--j; j; j--) {
        res = cal(V2, wht[s[j]]) + 1;
        upd(V1, s[j], res);
        upd(V2, wht[s[j]], res);
        hp.push(s[j]);
      }
    }
    printf("%d\n", V1[1]);
  }
  return 0;
}
