#include <bits/stdc++.h>
const int MAXN = 300010;
const int INF = 0x3f3f3f3f;
struct Tree {
  int tree[MAXN << 2];
  void modify(int u, int l, int r, int tar, int v) {
    if (l == r) return (void)(tree[u] = v);
    int mid = l + r >> 1;
    if (tar <= mid)
      modify(u << 1, l, mid, tar, v);
    else
      modify(u << 1 | 1, mid + 1, r, tar, v);
    tree[u] = std::max(tree[u << 1], tree[u << 1 | 1]);
  }
  int query(int u, int l, int r, int L, int R) {
    if (L <= l && r <= R) return tree[u];
    int mid = l + r >> 1, res = -INF;
    if (L <= mid) res = std::max(res, query(u << 1, l, mid, L, R));
    if (mid < R) res = std::max(res, query(u << 1 | 1, mid + 1, r, L, R));
    return res;
  }
  void print(int u, int l, int r, int R) {
    if (l == r) {
      printf("%d%c", tree[u], " \n"[r == R]);
      return;
    }
    int mid = l + r >> 1;
    print(u << 1, l, mid, R);
    print(u << 1 | 1, mid + 1, r, R);
  }
} tval, tt2;
int n, m, hi[MAXN], hiat[MAXN * 2 + 5];
std::set<int> trees;
int li[20], bak;
int main() {
  std::cin >> n >> m;
  const int R = m + 21;
  for (int T = 1; T <= m; ++T) {
    int opt, at, hs;
    std::cin >> opt >> at;
    if (opt == 1) {
      std::cin >> hs;
      hs += m - T + 10;
      hiat[hi[at] = hs] = at;
      trees.insert(at);
      for (int i = hs; i >= hs - 10; --i)
        if (int r = hiat[i]) {
          tt2.modify(1, 1, R, i, 0);
          tval.modify(1, 1, n, r, 0);
        }
      for (int i = hs; i >= hs - 10; --i)
        if (int r = hiat[i]) {
          int v = r + 1 <= n ? tval.query(1, 1, n, r + 1, n) : 0;
          tval.modify(1, 1, n, r, ++v);
          tt2.modify(1, 1, R, i, v);
        }
    } else {
      bak = 0;
      auto t = trees.begin();
      while (at-- > 0) {
        li[++bak] = *t;
        if (at != 0) ++t;
      }
      trees.erase(t);
      for (int i = 1; i <= bak; ++i) {
        tt2.modify(1, 1, R, hi[li[i]], 0);
        tval.modify(1, 1, n, li[i], 0);
      }
      for (int i = bak - 1; i; --i) {
        int v = tt2.query(1, 1, R, hi[li[i]] + 1, R) + 1;
        tt2.modify(1, 1, R, hi[li[i]], v);
        tval.modify(1, 1, n, li[i], v);
      }
      hiat[hi[li[bak]]] = 0;
      hi[li[bak]] = 0;
    }
    std::cout << tval.tree[1] << '\n';
  }
  return 0;
}
