#include <bits/stdc++.h>
using namespace std;
const int N = 210000;
const int add = 200002;
struct tree {
  int mid, l, r, max[2];
};
int n, m, x[N], y[N];
set<int> setx, sety;
int maxx(int x, int y) { return x > y ? x : y; }
tree tr[N * 5];
void build(int z, int l, int r) {
  tr[z].l = l;
  tr[z].r = r;
  tr[z].mid = (l + r) / 2;
  if (l != r) {
    build(z * 2, l, tr[z].mid);
    build(z * 2 + 1, tr[z].mid + 1, r);
  }
}
void ins(int z, int x, int v, int ord) {
  if (tr[z].l == tr[z].r) {
    tr[z].max[ord] = v;
    return;
  }
  if (x <= tr[z].mid)
    ins(z * 2, x, v, ord);
  else
    ins(z * 2 + 1, x, v, ord);
  tr[z].max[ord] = maxx(tr[z * 2].max[ord], tr[z * 2 + 1].max[ord]);
}
int cal(int z, int l, int r, int ord) {
  if (tr[z].l == l && tr[z].r == r) return tr[z].max[ord];
  if (r <= tr[z].mid)
    return cal(z * 2, l, r, ord);
  else if (l > tr[z].mid)
    return cal(z * 2 + 1, l, r, ord);
  else
    return maxx(cal(z * 2, l, tr[z].mid, ord),
                cal(z * 2 + 1, tr[z].mid + 1, r, ord));
}
int main() {
  scanf("%d%d", &n, &m);
  build(1, 1, N);
  int c, h, t, tot, tmp[20], longest;
  set<int>::iterator p;
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &c);
    if (c == 1) {
      scanf("%d%d", &t, &h);
      h = h - i + add;
      tot = 0;
      p = sety.begin();
      while (p != sety.end() && *p < h) {
        tmp[++tot] = *p;
        ins(1, x[*p], 0, 0);
        ins(1, *p, 0, 1);
        ++p;
      }
      y[t] = h;
      x[h] = t;
      tmp[++tot] = h;
      for (int j = tot; j > 0; --j) {
        longest = cal(1, x[tmp[j]] + 1, N, 0) + 1;
        ins(1, x[tmp[j]], longest, 0);
        ins(1, tmp[j], longest, 1);
      }
      setx.insert(t);
      sety.insert(h);
    } else {
      scanf("%d", &t);
      p = setx.begin();
      while (p != setx.end() && t > 1) {
        ++p;
        --t;
      }
      t = *p;
      h = y[t];
      tot = 0;
      p = setx.begin();
      while (p != setx.end() && *p < t) {
        tmp[++tot] = *p;
        ins(1, *p, 0, 0);
        ins(1, y[*p], 0, 1);
        ++p;
      }
      ins(1, h, 0, 1);
      ins(1, t, 0, 0);
      for (int j = tot; j > 0; --j) {
        longest = cal(1, y[tmp[j]] + 1, N, 1) + 1;
        ins(1, y[tmp[j]], longest, 1);
        ins(1, tmp[j], longest, 0);
      }
      p = setx.find(t);
      setx.erase(p);
      p = sety.find(h);
      sety.erase(p);
      x[h] = 0;
      y[t] = 0;
    }
    printf("%d\n", tr[1].max[1]);
  }
}
