#include <bits/stdc++.h>
using namespace std;
const int MaxN = 200020;
std::set<int> Set;
int n, m, pos[MaxN], h[MaxN];
struct SegmentTree {
  int dp[MaxN], Max[MaxN * 3];
  void Update(int p) { Max[p] = max(Max[p << 1], Max[p << 1 | 1]); }
  void Modify(int p, int l, int r, int Pos, int val) {
    if (l == r) {
      Max[p] = val;
      return;
    }
    int mid = l + r >> 1;
    if (Pos <= mid)
      Modify(p << 1, l, mid, Pos, val);
    else
      Modify(p << 1 | 1, mid + 1, r, Pos, val);
    Update(p);
  }
  int Query(int p, int l, int r, int R) {
    if (r <= R) return Max[p];
    int mid = l + r >> 1;
    if (mid < R)
      return max(Query(p << 1, l, mid, R), Query(p << 1 | 1, mid + 1, r, R));
    return Query(p << 1, l, mid, R);
  }
  void Insert(int Pos, int val) {
    dp[Pos] = Query(1, 0, val, Pos - 1) + 1;
    Modify(1, 0, val, Pos, dp[Pos]);
  }
} Tp, Th;
int main() {
  scanf("%d%d", &n, &m);
  for (int t = 1; t <= m; t++) {
    int op, Pos, H;
    scanf("%d%d", &op, &Pos);
    if (op == 1) {
      scanf("%d", &H);
      Pos = n - Pos + 1, H = t + 10 - H;
      pos[H] = Pos, h[Pos] = H;
      Set.insert(Pos);
      for (int i = H + 1; i <= H + 9; i++)
        if (pos[i]) Tp.Modify(1, 0, n, pos[i], 0);
      for (int i = H; i <= H + 9; i++)
        if (pos[i]) {
          Tp.Insert(pos[i], n);
          Th.dp[i] = Tp.dp[pos[i]];
          Th.Modify(1, 0, m + 10, i, Th.dp[i]);
        }
      printf("%d\n", Tp.Max[1]);
    } else {
      std::set<int>::iterator it = Set.end();
      while (Pos--) {
        it--;
        Th.Modify(1, 0, m + 10, h[*it], 0);
      }
      Tp.Modify(1, 0, n, *it, 0);
      pos[h[*it]] = 0;
      for (Set.erase(it++); it != Set.end(); it++) {
        Th.Insert(h[*it], m + 10);
        Tp.dp[*it] = Th.dp[h[*it]];
        Tp.Modify(1, 0, n, *it, Tp.dp[*it]);
      }
      printf("%d\n", Tp.Max[1]);
    }
  }
  return 0;
}
