#include <bits/stdc++.h>
using namespace std;
int mi = -200050, ma = 200050;
vector<int> vc[15], my;
vector<int> tree[14];
int pre[100005], val[100005], kokhn[100005], borto[100005], vis[100005],
    seq[100005];
set<int> s;
set<int>::iterator it;
void update(int node, int st, int en, int pos, int v, int id) {
  if (st > pos or en < pos) return;
  if (st == en) {
    tree[id][node] = v;
    return;
  }
  int mid = (st + en) >> 1;
  update(node * 2, st, mid, pos, v, id);
  update(node * 2 + 1, mid + 1, en, pos, v, id);
  tree[id][node] = max(tree[id][node * 2], tree[id][node * 2 + 1]);
}
int query(int node, int st, int en, int l, int r, int id) {
  if (st > r or en < l) return 0;
  if (st >= l and en <= r) {
    return tree[id][node];
  }
  int mid = (st + en) >> 1;
  int p = query(node * 2, st, mid, l, r, id);
  int q = query(node * 2 + 1, mid + 1, en, l, r, id);
  return max(p, q);
}
void func(int kto, int n) {
  for (int i = 0; i < my.size(); i++) {
    int g = my[i];
    update(1, mi, ma, val[g], 0, 12);
  }
  for (int i = my.size() - 1; i >= 0; i--) {
    int g = my[i];
    int boyos = pre[g] + kto - kokhn[g];
    int lo = mi, high = ma, ans = INT_MIN;
    while (lo <= high) {
      int mid = (lo + high) >> 1;
      int tot = mid + kto - 1;
      if (tot > boyos) {
        ans = mid;
        high = mid - 1;
      } else
        lo = mid + 1;
    }
    int r = 1;
    if (ans > INT_MIN) r += query(1, mi, ma, ans, ma, 12);
    seq[g] = r;
    update(1, 1, n, g, seq[g], borto[g]);
    update(1, mi, ma, val[g], seq[g], 12);
    s.insert(g);
  }
}
void taken(int n) {
  for (int i = 10; i >= 1; i--) {
    for (int j = 0; j < vc[i].size(); j++) {
      int g = vc[i][j];
      update(1, 1, n, g, 0, i);
      update(1, 1, n, g, seq[g], i + 1);
      borto[g] = i + 1;
      vc[i + 1].push_back(g);
    }
    vc[i].clear();
  }
}
vector<int> q;
void ou() {
  int g = tree[12][1];
  printf("%d\n", g);
}
int main() {
  int i, j, k, l, m, n;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= 11; i++) tree[i].resize((n + 1) * 4);
  tree[12].resize((500000) * 4);
  for (int i = 1; i <= m; i++) {
    taken(n);
    int ty;
    scanf("%d", &ty);
    if (ty == 1) {
      scanf("%d%d", &l, &k);
      int ret = 0;
      for (int j = k + 1; j <= 11; j++) {
        ret = max(query(1, 1, n, l + 1, n, j), ret);
      }
      ret++;
      seq[l] = ret;
      val[l] = k - (i - 1);
      kokhn[l] = i;
      pre[l] = k;
      borto[l] = k;
      update(1, mi, ma, val[l], ret, 12);
      update(1, 1, n, l, ret, k);
      vc[k].push_back(l);
      vis[l] = 1;
      q.push_back(l);
      s.insert(l);
      vector<int> tmp;
      for (int j = q.size() - 1, cnt = 1; j >= 0, cnt <= 10; j--, cnt++) {
        if (q[j] < l && vis[q[j]]) tmp.push_back(q[j]);
      }
      tmp.push_back(l);
      sort(tmp.begin(), tmp.end());
      for (int j = tmp.size() - 1; j >= 0; j--) {
        int g = tmp[j];
        int boyos = pre[g] + i - kokhn[g];
        int ans = seq[g], ans2 = seq[g];
        for (int k = j + 1; k < tmp.size(); k++) {
          int h = tmp[k];
          int boyos2 = pre[h] + i - kokhn[h];
          if (boyos2 > boyos) {
            ans2 = max(ans2, seq[h] + 1);
          }
        }
        if (ans >= ans2) continue;
        seq[g] = ans2;
        update(1, 1, n, g, ans2, borto[g]);
        update(1, mi, ma, val[g], ans2, 12);
      }
      ou();
      continue;
    }
    int cnt = 1;
    scanf("%d", &k);
    my.clear();
    while (s.size()) {
      it = s.begin();
      l = *it;
      s.erase(*it);
      vis[l] = 0;
      if (cnt == k) break;
      cnt++;
      vis[l] = 1;
      my.push_back(l);
    }
    update(1, 1, n, l, 0, borto[l]);
    update(1, mi, ma, val[l], 0, 12);
    seq[l] = 0;
    func(i, n);
    ou();
  }
}
