#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005, M = (1 << 18) - 1;
struct Seq {
  int a[M + M];
  void modify(int x, int y) {
    for (x += M, a[x] = y; x != 1; x >>= 1) a[x >> 1] = max(a[x], a[x ^ 1]);
  }
  int query(int x) {
    int ret = 0;
    for (x += M; x != 1; x >>= 1)
      if (~x & 1) ret = max(ret, a[x ^ 1]);
    return ret;
  }
} T1, T2;
priority_queue<int, vector<int>, greater<int> > q;
int n, m, pos[M], val[MAXN], qu[MAXN];
void plant(int p, int h) {
  q.push(p);
  val[pos[h] = p] = h;
  for (int i = max(h - 10, 0); i < h; i++)
    if (pos[i]) T1.modify(pos[i], 0);
  for (int i = h; i >= max(h - 10, 0); i--)
    if (pos[i]) {
      int tmp = T1.query(pos[i]) + 1;
      T1.modify(pos[i], tmp);
      T2.modify(i, tmp);
    }
}
void cut(int x) {
  int w[16];
  for (int i = 0; i < x; i++) {
    T2.modify(val[w[i] = q.top()], 0);
    q.pop();
  }
  T1.modify(w[x - 1], 0);
  pos[val[w[x - 1]]] = 0;
  val[w[x - 1]] = 0;
  for (int i = x - 2; i >= 0; i--) {
    int tmp = T2.query(val[w[i]]) + 1;
    T1.modify(w[i], tmp);
    T2.modify(val[w[i]], tmp);
    q.push(w[i]);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int type, p, h;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d%d", &p, &h);
      plant(p, h + m - i);
    } else {
      scanf("%d", &p);
      cut(p);
    }
    printf("%d\n", T1.a[1]);
  }
  return 0;
}
