#include <bits/stdc++.h>
const int N = 200099 * 4;
int s[N], m, n, p[N], h[N], f[N], exist[N];
std::set<std::pair<int, int> > a;
struct SegmentTree {
  int Max[N], P, V1, V2, n;
  void _modify(const int id, const int l, const int r) {
    if (l == r) return (void)(Max[id] = V1);
    const int mid = (l + r) / 2;
    if (P <= mid)
      _modify(id * 2, l, mid);
    else
      _modify(id * 2 + 1, mid + 1, r);
    Max[id] = std::max(Max[id * 2], Max[id * 2 + 1]);
  }
  void modify(const int x, const int y) {
    P = x;
    V1 = y;
    _modify(1, 1, n);
  }
  int _query(const int id, const int l, const int r) {
    if (l >= P) return Max[id];
    const int mid = (l + r) / 2;
    int res = 0;
    if (P <= mid) res = std::max(res, _query(id * 2, l, mid));
    res = std::max(res, _query(id * 2 + 1, mid + 1, r));
    return res;
  }
  int query(const int x) {
    P = x;
    return _query(1, 1, n);
  }
} Tx, Ty;
int main() {
  scanf("%d%d", &n, &m);
  Tx.n = n + 1;
  Ty.n = m + 10;
  for (int i = 1, t, x; i <= m; ++i) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%d", p + i, h + i);
      h[i] += m - i;
      exist[h[i]] = i;
      s[0] = 0;
      for (int j = m - i + 1; j < h[i]; ++j)
        if (exist[j]) s[++s[0]] = exist[j];
      for (int j = 1; j <= s[0]; ++j) Tx.modify(p[s[j]], 0);
      s[++s[0]] = i;
      for (int j = s[0]; j; --j) {
        f[s[j]] = Tx.query(p[s[j]] + 1) + 1;
        Tx.modify(p[s[j]], f[s[j]]);
        Ty.modify(h[s[j]], f[s[j]]);
      }
      a.insert(std::pair<int, int>(p[i], i));
    } else {
      scanf("%d", &x);
      s[0] = 0;
      for (std::set<std::pair<int, int> >::iterator j = a.begin(); x;
           --x, ++j) {
        s[++s[0]] = j->second;
        if (x == 1) {
          a.erase(j);
          break;
        }
      }
      exist[h[s[s[0]]]] = 0;
      for (int j = 1; j < s[0]; ++j) Ty.modify(h[s[j]], 0);
      Tx.modify(p[s[s[0]]], 0);
      Ty.modify(h[s[s[0]]], 0);
      for (int j = s[0] - 1; j; --j) {
        f[s[j]] = Ty.query(h[s[j]] + 1) + 1;
        Tx.modify(p[s[j]], f[s[j]]);
        Ty.modify(h[s[j]], f[s[j]]);
      }
    }
    printf("%d\n", Tx.Max[1]);
  }
}
