#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, r, num;
int ty[200010], p[200010], h[200010], tr[200010 * 4], an[200010], id[200010],
    wei[200010], F[200010], g[200010];
multiset<int> Set, a[200010];
inline void Inc(int x) {
  int H = 200010 - h[x];
  for (; H < 200010; H += H & -H) a[H].insert(an[x]);
}
inline void Del(int x) {
  int H = 200010 - h[x];
  for (; H < 200010; H += H & -H) {
    multiset<int>::iterator A = a[H].find(an[x]);
    a[H].erase(A);
  }
}
inline int Cal(int x) {
  int H = 200010 - h[x], an = 0;
  for (; H; H -= H & -H)
    if (!a[H].empty()) {
      multiset<int>::iterator A = a[H].end();
      an = max(an, *(--A));
    }
  return an + 1;
}
int cal(int q, int x, int y, int k) {
  if (k <= x) return tr[q];
  int mid = (x + y) / 2, an = 0;
  if (k <= mid) an = cal(q * 2, x, mid, k);
  an = max(an, cal(q * 2 + 1, mid + 1, y, k));
  return an;
}
inline void update(int x) { tr[x] = max(tr[x * 2], tr[x * 2 + 1]); }
void into(int q, int x, int y, int k, int t) {
  if (x == y) {
    tr[q] = t;
    return;
  }
  int mid = (x + y) / 2;
  if (k <= mid)
    into(q * 2, x, mid, k, t);
  else
    into(q * 2 + 1, mid + 1, y, k, t);
  update(q);
}
inline void print() {
  int ans = tr[1];
  for (j = max(1, i - 9); j <= i; j++)
    if (ty[j] == 1) ans = max(ans, an[j]);
  printf("%d\n", ans);
}
inline bool cc1(const int &a, const int &b) { return p[a] > p[b]; }
inline void hunhe() {
  sort(id + 1, id + r + 1, cc1);
  for (j = 1; j <= r; j++) {
    int A = id[j];
    for (k = 1; k <= j - 1; k++) {
      int B = id[k];
      if (h[B] > h[A]) an[A] = max(an[A], an[B] + 1);
    }
  }
}
inline void inc(int x) {
  int len = min(10, (int)Set.size());
  {
    multiset<int>::iterator A;
    if (len == 10) {
      A = Set.begin();
      for (j = 1; j <= 9; j++) A++;
      if (x < *A && wei[*A] < i - 10) Inc(wei[*A]);
    }
    wei[x] = i;
    Set.insert(x);
    len = min(10, (int)Set.size());
    A = Set.begin();
    ++num;
    for (j = 1; j <= len; j++) F[wei[*A]] = num, A++;
  }
  if (i > 10 && ty[i - 10] == 1) {
    into(1, 1, n, p[i - 10], an[i - 10]);
    if (F[i - 10] != num) Inc(i - 10);
  }
  an[i] = cal(1, 1, n, x) + 1;
  id[r = 1] = i;
  for (j = max(1, i - 9); j <= i - 1; j++)
    if (ty[j] == 1) id[++r] = j;
  hunhe();
  print();
}
inline void del(int x) {
  int len = min(11, (int)Set.size());
  {
    multiset<int>::iterator A;
    ++num;
    A = Set.begin();
    for (j = 1; j <= len; j++) g[j] = wei[*A], F[wei[*A]] = num, A++;
    if (len == 11 && g[len] < i - 10) Del(g[len]);
    A = Set.begin();
    for (j = 1; j <= x - 1; j++) A++;
    Set.erase(A);
  }
  if (i > 10 && ty[i - 10] == 1) {
    into(1, 1, n, p[i - 10], an[i - 10]);
    if (F[i - 10] != num) Inc(i - 10);
  }
  if (g[x] > i - 10)
    ty[g[x]] = 0;
  else
    into(1, 1, n, p[g[x]], 0);
  for (j = 1; j <= x - 1; j++) {
    int B = g[j];
    an[B] = Cal(B);
  }
  r = 0;
  for (j = 1; j <= len; j++)
    if (j != x) id[++r] = g[j];
  for (j = max(1, i - 9); j <= i - 1; j++)
    if (ty[j] == 1) id[++r] = j;
  hunhe();
  for (j = 1; j <= x - 1; j++) {
    int B = g[j];
    if (B <= i - 10) into(1, 1, n, p[B], an[B]);
  }
  print();
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d", &ty[i]);
    if (ty[i] == 1) {
      scanf("%d%d", &p[i], &h[i]);
      h[i] = h[i] + (m - i);
      inc(p[i]);
    } else {
      scanf("%d", &k);
      del(k);
    }
  }
  return 0;
}
