#include <bits/stdc++.h>
using namespace std;
const int siz = 262144;
typedef int arr[siz << 1];
struct Tree {
  arr a;
  Tree() : a() {}
  void ins(int pos, int zhi) {
    a[pos += siz] = zhi;
    for (; pos > 1; pos >>= 1) a[pos >> 1] = max(a[pos], a[pos ^ 1]);
  }
  int quer(int l) {
    int ret = 0, r = siz << 1;
    for (l += siz; l > 0 && l < r; l >>= 1, r >>= 1)
      if (~l & 1) ret = max(ret, a[l + 1]);
    return ret;
  }
  inline int querall() { return a[1]; }
} A, B, C;
arr ht, ans;
int ANS;
arr A10, B10;
int Aop, Bop;
int i, m, qi;
int cmd, u, j;
int main() {
  scanf("%d%d", &i, &m);
  Aop = 0;
  Bop = 0;
  for (qi = m - 1; qi >= 0; qi--) {
    if (Aop > 0 && ht[A10[Aop - 1]] == qi + 11) {
      Aop--;
      A.ins(A10[Aop], ans[A10[Aop]]);
    }
    if (qi == 7) qi = 7;
    if (qi == 10) qi = 10;
    scanf("%d%d", &cmd, &u);
    if (cmd == 1) {
      scanf("%d", ht + u);
      ht[u] += qi;
      ans[u] = A.quer(u) + 1;
      for (i = 0; i < Aop; i++)
        if (ht[u] < ht[A10[i]]) break;
      for (j = Aop; j > i; j--) {
        A10[j] = A10[j - 1];
        if (u < A10[j]) ans[u] = max(ans[u], ans[A10[j]] + 1);
      }
      A10[j] = u;
      Aop++;
      for (u = i; i > 0; i--)
        for (j = i - 1; j >= 0; j--)
          if (A10[j] < A10[i]) ans[A10[j]] = max(ans[A10[j]], ans[A10[i]] + 1);
      for (i = 0; i < Bop; i++)
        if (A10[u] < B10[i]) break;
      for (j = Bop; j > i; j--) B10[j] = B10[j - 1];
      B10[j] = A10[u];
      Bop++;
      for (i = 0; i <= u; i++) {
        for (j = 0; j < Bop; j++)
          if (A10[i] == B10[j]) break;
        if (j == Bop) B.ins(ht[A10[i]], ans[A10[i]]);
      }
      if (Bop == 11) {
        Bop--;
        C.ins(B10[10], siz - B10[10]);
        B.ins(ht[B10[10]], ans[B10[10]]);
      }
    }
    if (cmd == 2) {
      i = u - 1;
      u = B10[i];
      ans[u] = 0;
      ht[u] = 0;
      for (j = 0; j < Aop; j++)
        if (A10[j] == u) break;
      if (j < Aop)
        for (Aop--; j < Aop; j++) A10[j] = A10[j + 1];
      else
        A.ins(u, 0);
      for (Bop--, j = i; j < Bop; j++) B10[j] = B10[j + 1];
      for (i--; i >= 0; i--) {
        ans[B10[i]] = B.quer(ht[B10[i]]) + 1;
        for (j = i + 1; j < Bop; j++)
          if (ht[B10[i]] < ht[B10[j]])
            ans[B10[i]] = max(ans[B10[i]], ans[B10[j]] + 1);
        for (j = 0; j < Aop; j++)
          if (B10[i] == A10[j]) break;
        if (j == Aop) A.ins(B10[i], ans[B10[i]]);
      }
      u = C.querall();
      if (u > 0) {
        u = siz - u;
        C.ins(u, 0);
        B.ins(ht[u], 0);
        B10[Bop++] = u;
      }
    }
    ANS = A.querall();
    for (i = 0; i < Aop; i++) ANS = max(ANS, ans[A10[i]]);
    printf("%d\n", ANS);
  }
  return 0;
}
