#include <bits/stdc++.h>
using namespace std;
const int MAXN = 220000;
struct SegmentTree {
  struct Node {
    int l, r;
    int cnt, val;
  } tr[4 * MAXN];
  int d[MAXN];
  inline void cov(int x, int k) {
    tr[x].val = k;
    tr[x].cnt = k != 0 ? 1 : 0;
  }
  inline void pushup(int x) {
    tr[x].val = max(tr[(x << 1)].val, tr[(x << 1 | 1)].val);
    tr[x].cnt = tr[(x << 1)].cnt + tr[(x << 1 | 1)].cnt;
  }
  void build(int x, int l, int r) {
    tr[x].l = l;
    tr[x].r = r;
    if (tr[x].l == tr[x].r) {
      cov(x, 0);
      d[tr[x].l] = 0;
      return;
    }
    int mid = l + r >> 1;
    build((x << 1), l, mid);
    build((x << 1 | 1), mid + 1, r);
    pushup(x);
  }
  void update(int x, int p, int k) {
    if (tr[x].l == tr[x].r) {
      cov(x, k);
      return;
    }
    int mid = tr[x].l + tr[x].r >> 1;
    if (p <= mid)
      update((x << 1), p, k);
    else
      update((x << 1 | 1), p, k);
    pushup(x);
  }
  int kth(int x, int k) {
    if (k > tr[x].cnt) return 0;
    if (tr[x].l == tr[x].r) return tr[x].l;
    if (k <= tr[(x << 1)].cnt)
      return kth((x << 1), k);
    else
      return kth((x << 1 | 1), k - tr[(x << 1)].cnt);
  }
  int query(int x, int l, int r) {
    if (tr[x].l > r || tr[x].r < l) return 0;
    if (l <= tr[x].l && tr[x].r <= r) return tr[x].val;
    return max(query((x << 1), l, r), query((x << 1 | 1), l, r));
  }
} tp, th;
int main() {
  int n, m, c;
  scanf("%d%d", &n, &m);
  c = m;
  tp.build(1, 1, n);
  th.build(1, 1, m + 9);
  while (c--) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int p, h, k = 0;
      int s[10], v[10];
      scanf("%d%d", &p, &h);
      for (int i = 1; i <= 9; i++) {
        int t = th.kth(1, i);
        if (!t || t > h + c) break;
        s[++k] = th.d[t];
        v[k] = th.query(1, t, t);
        tp.update(1, th.d[t], 0);
      }
      tp.d[p] = h + c;
      th.d[h + c] = p;
      int w = tp.query(1, p + 1, n) + 1;
      tp.update(1, p, w);
      th.update(1, tp.d[p], w);
      for (int i = k; i >= 1; i--) {
        w = tp.query(1, s[i] + 1, n) + 1;
        tp.update(1, s[i], w);
        th.update(1, tp.d[s[i]], w);
      }
    } else {
      int k, s[10];
      scanf("%d", &k);
      for (int i = 1; i < k; i++) {
        int t = tp.kth(1, i);
        s[i] = tp.d[t];
        th.update(1, tp.d[t], 0);
      }
      int h = tp.d[tp.kth(1, k)];
      th.update(1, h, 0);
      tp.update(1, th.d[h], 0);
      for (int i = k - 1; i >= 1; i--) {
        int w = th.query(1, s[i] + 1, m + 9) + 1;
        th.update(1, s[i], w);
        tp.update(1, th.d[s[i]], w);
      }
    }
    printf("%d\n", tp.tr[1].val);
  }
  return 0;
}
