#include <bits/stdc++.h>
const int N = 200500;
int n, m, h[N], ih[N];
std::set<int> pos, height;
struct segment {
  int max[N << 2];
  void modify(int pos, int v, int o = 1, int l = 1, int r = 200010) {
    if (l == r) {
      max[o] = v;
      return;
    }
    int mid = l + r >> 1;
    if (pos <= mid)
      modify(pos, v, o << 1, l, mid);
    else
      modify(pos, v, o << 1 | 1, mid + 1, r);
    max[o] = std::max(max[o << 1], max[o << 1 | 1]);
  }
  int query(int L, int R, int o = 1, int l = 1, int r = 200010) {
    if (L <= l && R >= r) return max[o];
    int mid = l + r >> 1, ret = 0;
    if (L <= mid) ret = std::max(ret, query(L, R, o << 1, l, mid));
    if (R > mid) ret = std::max(ret, query(L, R, o << 1 | 1, mid + 1, r));
    return ret;
  }
} spos, sheight;
int stack[10];
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0);
  std::cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int opt, p, x;
    std::cin >> opt;
    if (opt == 1) {
      std::cin >> p, std::cin >> h[p], h[p] += m - i, ih[h[p]] = p;
      std::set<int>::iterator it = height.begin();
      int tot = 0;
      while (it != height.end() && *it < h[p])
        stack[tot++] = *it, spos.modify(ih[*it++], 0);
      stack[tot++] = h[p];
      for (int i = tot - 1; ~i; --i) {
        int dp = spos.query(ih[stack[i]], n) + 1;
        sheight.modify(stack[i], dp);
        spos.modify(ih[stack[i]], dp);
      }
      height.insert(h[p]);
      pos.insert(p);
    } else {
      std::cin >> x;
      std::set<int>::iterator it = pos.begin();
      for (int i = 0; i < x - 1; ++i, ++it)
        stack[i] = *it, sheight.modify(h[*it], 0);
      sheight.modify(h[*it], 0);
      spos.modify(*it, 0);
      for (int i = x - 2; ~i; --i) {
        int dp = sheight.query(h[stack[i]], 200010) + 1;
        sheight.modify(h[stack[i]], dp);
        spos.modify(stack[i], dp);
      }
      height.erase(h[*it]);
      pos.erase(it);
    }
    std::cout << spos.query(1, n) << '\n';
  }
  return 0;
}
