#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
const long long INF = ~0LLU >> 1;
int rd() { return RAND_MAX == 32767 ? ((rand() << 15) ^ rand()) : rand(); }
const int maxn = 200010;
const int maxt = 2000000;
int n, tt;
int s[maxt], mx[maxt], key[maxt], val[maxt], ch[maxt][2];
int h[maxn], t[maxn];
set<pair<int, int> > S;
set<int> T;
int Calc(int t, int x) {
  int res = 0;
  while (t != 0) {
    if (key[t] > x) {
      res = max(res, max(mx[ch[t][1]], val[t]));
      t = ch[t][0];
    } else
      t = ch[t][1];
  }
  return res;
}
void Fresh(int t) { mx[t] = max(val[t], max(mx[ch[t][0]], mx[ch[t][1]])); }
void Rotate(int &t, int x) {
  int k = ch[t][x];
  ch[t][x] = ch[k][1 - x];
  ch[k][1 - x] = t;
  s[k] = s[t];
  mx[k] = mx[t];
  s[t] = s[ch[t][0]] + s[ch[t][1]] + 1;
  Fresh(t);
  t = k;
}
void Maintain(int &t, int x) {
  if (s[ch[ch[t][x]][x]] > s[ch[t][1 - x]])
    Rotate(t, x);
  else if (s[ch[ch[t][x]][1 - x]] > s[ch[t][1 - x]]) {
    Rotate(ch[t][x], 1 - x);
    Rotate(t, x);
  } else
    return;
  Maintain(ch[t][0], 0);
  Maintain(ch[t][1], 1);
  Maintain(t, 0);
  Maintain(t, 1);
}
void Insert(int &t, int x, int y) {
  if (t == 0) {
    t = ++tt;
    key[t] = x;
    mx[t] = val[t] = y;
    s[t] = 1;
    ch[t][0] = ch[t][1] = 0;
    return;
  }
  s[t]++;
  Insert(ch[t][x > key[t]], x, y);
  Fresh(t);
  Maintain(t, x > key[t]);
}
void Change(int t, int x, int y) {
  if (key[t] == x) {
    val[t] = y;
    Fresh(t);
  } else {
    Change(ch[t][x > key[t]], x, y);
    Fresh(t);
  }
}
void Delete(int &t, int x) {
  if (key[t] == x) {
    if (ch[t][0] == 0 || ch[t][1] == 0) {
      t = ch[t][0] + ch[t][1];
      return;
    }
    Rotate(t, 0);
    s[t]--;
    Delete(ch[t][1], x);
    Fresh(t);
    Maintain(t, 1);
  } else {
    s[t]--;
    Delete(ch[t][x > key[t]], x);
    Fresh(t);
  }
}
int Query(int x, int y) {
  int res = 0;
  for (int i = x; i; i -= (i & -i)) res = max(res, Calc(t[i], y));
  return res;
}
void Add(int x, int y) {
  for (int i = x; i <= n; i += (i & -i)) Insert(t[i], h[n - x], y);
}
void Fre(int x, int y) {
  for (int i = x; i <= n; i += (i & -i)) Change(t[i], h[n - x], y);
}
void Del(int x) {
  for (int i = x; i <= n; i += (i & -i)) Delete(t[i], h[n - x]);
}
int main() {
  int m;
  scanf("%d%d", &n, &m);
  tt = s[0] = mx[0] = key[0] = val[0] = ch[0][0] = ch[0][1] = 0;
  for (int i = 0; i <= n; i++) t[i] = 0;
  S.clear();
  for (int i = 0; i < m; i++) {
    int opt, pos, hei, rk;
    scanf("%d", &opt);
    if (opt == 1) {
      scanf("%d%d", &pos, &hei);
      pos--;
      hei -= i;
      h[pos] = hei;
      vector<pair<int, int> > tmp;
      while (!S.empty() && (*S.begin()).first < hei) {
        tmp.push_back(*S.begin());
        S.erase(S.begin());
      }
      int ret = Query(n - pos - 1, hei);
      Add(n - pos, ret + 1);
      S.insert(make_pair(hei, pos));
      for (int j = 0; j < tmp.size(); j++) S.insert(tmp[j]);
      T.insert(pos);
      sort(tmp.begin(), tmp.end());
      for (int j = tmp.size() - 1; j >= 0; j--) {
        int hi = tmp[j].first;
        int ps = tmp[j].second;
        int ret = Query(n - ps - 1, hi);
        Fre(n - ps, ret + 1);
      }
    } else {
      scanf("%d", &rk);
      set<int>::iterator it = T.begin();
      for (int j = 1; j < rk; j++) it++;
      int ps = *it;
      int hi = h[ps];
      S.erase(make_pair(hi, ps));
      T.erase(ps);
      Del(n - ps);
      it = T.begin();
      for (int j = 1; j < rk; j++, it++)
        ;
      for (int j = 1; j < rk; j++) {
        it--;
        int ps = *it;
        int ret = Query(n - ps - 1, h[ps]);
        Fre(n - ps, ret + 1);
      }
    }
    int res = 0;
    for (int j = n; j; j -= (j & -j)) res = max(res, mx[t[j]]);
    cout << res << endl;
  }
  return 0;
}
