#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
int MX = (1 << 18) - 2;
int M = (1 << 18), T[2][1 << 19];
void update(int ty, int l, int v) {
  l += M;
  T[ty][l] = v;
  while (l > 1) {
    T[ty][l >> 1] = max(T[ty][l], T[ty][l ^ 1]);
    l >>= 1;
  }
}
int query(int ty, int l) {
  int ans = 0;
  int r = MX;
  for (l = l + M - 1, r = r + M + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
    if (~l & 1) ans = max(ans, T[ty][l ^ 1]);
    if (r & 1) ans = max(ans, T[ty][r ^ 1]);
  }
  return ans;
}
set<int> sx, sy;
int xc[200105], yc[200105];
void add(int x, int y) {
  sx.insert(x);
  sy.insert(y);
  xc[x] = y;
  yc[y] = x;
  vector<pair<int, int>> v;
  for (int y2 : sy) {
    int x2 = yc[y2];
    update(0, x2, 0);
    update(1, y2, 0);
    v.push_back({x2, y2});
    if (y2 == y) break;
  }
  for (int i = v.size() - 1; i >= 0; i--) {
    int x2 = v[i].first, y2 = v[i].second;
    int tt = query(0, x2 + 1) + 1;
    update(0, x2, tt);
    update(1, y2, tt);
  }
}
void del(int x) {
  int x2;
  vector<pair<int, int>> v;
  for (int c : sx) {
    x2 = c;
    int y2 = xc[x2];
    update(0, x2, 0);
    update(1, y2, 0);
    x--;
    if (x == 0) break;
    v.push_back({x2, y2});
  }
  int y2 = xc[x2];
  sx.erase(x2);
  sy.erase(y2);
  for (int i = v.size() - 1; i >= 0; i--) {
    int x2 = v[i].first, y2 = v[i].second;
    int tt = query(1, y2 + 1) + 1;
    update(0, x2, tt);
    update(1, y2, tt);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int t, p, h, x;
  for (int(i) = 1; (i) <= (int)(m); (i)++) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%d", &p, &h);
      add(p, h - i + m);
    } else {
      scanf("%d", &x);
      del(x);
    }
    printf("%d\n", query(0, 1));
  }
  return 0;
}
