#include <bits/stdc++.h>
using namespace std;
template <class T>
T two(T x) {
  return 1 << x;
}
template <class T>
inline void Min(T &x, T y) {
  if (y < x) x = y;
}
template <class T>
inline void Max(T &x, T y) {
  if (y > x) x = y;
}
const int maxn = 200010;
const int mod = 1000000007;
const int inf = ~0u >> 2;
const int N = (1 << 18);
struct segtree {
  int dp[1 << 19];
  void update(int p, int val, int l, int r, int rt) {
    if (l == r) {
      dp[rt] = val;
      return;
    }
    int m = l + r >> 1;
    if (p <= m) update(p, val, l, m, rt << 1);
    if (p > m) update(p, val, m + 1, r, rt << 1 | 1);
    dp[rt] = max(dp[rt << 1], dp[rt << 1 | 1]);
  }
  int query(int L, int R, int l, int r, int rt) {
    if (L <= l && r <= R) {
      return dp[rt];
    }
    int m = l + r >> 1;
    int ans = 0;
    if (L <= m) ans = max(ans, query(L, R, l, m, rt << 1));
    if (R > m) ans = max(ans, query(L, R, m + 1, r, rt << 1 | 1));
    return ans;
  }
  int query(int p) { return query(p, N, 1, N, 1); }
  void update(int p, int val) { update(p, val, 1, N, 1); }
};
segtree sgx, sgy;
int n, m;
int toy[maxn + 50], tox[maxn + 50];
stack<int> st;
set<int> Q;
void plant(int x, int h) {
  toy[x] = h;
  tox[h] = x;
  Q.insert(x);
  for (int i = h - 10; i <= h; i++) {
    if (tox[i]) {
      x = tox[i];
      sgx.update(x, 0);
      sgy.update(i, 0);
      st.push(i);
    }
  }
  while (!st.empty()) {
    h = st.top();
    st.pop();
    x = tox[h];
    int mx = sgx.query(x + 1) + 1;
    sgx.update(x, mx);
    sgy.update(h, mx);
  }
}
void cut(int p) {
  int x, h;
  while (p) {
    x = *Q.begin(), Q.erase(Q.begin());
    if (toy[x]) {
      p--;
      st.push(x);
      sgx.update(x, 0);
      sgy.update(toy[x], 0);
    }
  }
  x = st.top();
  st.pop();
  h = toy[x];
  tox[h] = toy[x] = 0;
  while (!st.empty()) {
    x = st.top();
    st.pop();
    h = toy[x];
    int mx = sgy.query(h + 1) + 1;
    sgx.update(x, mx);
    sgy.update(h, mx);
    Q.insert(x);
  }
}
int main() {
  int op, p, h;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d%d", &p, &h);
      plant(p, h + maxn - i);
    } else {
      scanf("%d", &p);
      cut(p);
    }
    printf("%d\n", sgx.query(1));
  }
  return 0;
}
