#include <bits/stdc++.h>
const double eps = 1e-10;
using namespace std;
const int NN = (555555);
const int NZ = 200022;
const int MM = 151;
const int need = (1 << 30) - 1;
using PII = pair<int, int>;
int N, M, n, m, p, h, q, k, t;
int zzz = 0;
int tr[2][NN * 2];
struct seg {
  int *sg;
  seg() { sg = tr[zzz++]; }
  void up(int v, int tl, int tr, int i, int val) {
    if (tl == tr) {
      sg[v] = val;
      return;
    }
    if (i <= ((tl + tr) >> 1)) {
      up((v << 1), tl, ((tl + tr) >> 1), i, val);
    } else
      up(((v << 1) | 1), ((tl + tr) >> 1) + 1, tr, i, val);
    sg[v] = max(sg[(v << 1)], sg[((v << 1) | 1)]);
  }
  int get(int v, int tl, int tr, int l, int r) {
    if (tl > r || tr < l) return 0;
    if (tl >= l && tr <= r) {
      return sg[v];
    }
    return max(get((v << 1), tl, ((tl + tr) >> 1), l, r),
               get(((v << 1) | 1), ((tl + tr) >> 1) + 1, tr, l, r));
  }
};
seg sgx, sgy;
set<int> sx, sy;
int xt[NN], yt[NN];
void planting(int x, int y) {
  sx.insert(x);
  sy.insert(y);
  xt[x] = y;
  yt[y] = x;
  vector<PII> vc;
  for (auto it : sy) {
    int y2 = it;
    int x2 = yt[y2];
    sgx.up(1, 0, NZ, x2, 0);
    sgy.up(1, 0, NZ, y2, 0);
    vc.push_back({x2, y2});
    if (y2 == y) break;
  }
  for (int i = vc.size() - 1; i >= 0; i--) {
    int x2 = vc[i].first, y2 = vc[i].second;
    int sg = sgx.get(1, 0, NZ, x2 + 1, NZ) + 1;
    sgx.up(1, 0, NZ, x2, sg);
    sgy.up(1, 0, NZ, y2, sg);
  }
}
void remove(int c) {
  vector<PII> vc;
  for (auto it : sx) {
    int x2 = it, y2 = xt[x2];
    sgx.up(1, 0, NZ, x2, 0);
    sgy.up(1, 0, NZ, y2, 0);
    vc.push_back({x2, y2});
    c--;
    if (c == 0) break;
  }
  for (int i = vc.size() - 1; i >= 0; i--) {
    int x2 = vc[i].first, y2 = vc[i].second;
    int tmp = 0;
    if (i == vc.size() - 1) {
      sx.erase(x2);
      sy.erase(y2);
    } else {
      tmp = sgy.get(1, 0, NZ, y2 + 1, NZ) + 1;
    }
    sgx.up(1, 0, NZ, x2, tmp);
    sgy.up(1, 0, NZ, y2, tmp);
  }
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 0; i < q; i++) {
    int x;
    scanf("%d", &x);
    if (x == 1) {
      scanf("%d %d", &p, &h);
      p--;
      planting(p, h - i + q);
    } else {
      scanf("%d", &p);
      remove(p);
    }
    int pas = sgx.get(1, 0, NZ, 0, NZ);
    printf("%d\n", pas);
  }
  return 0;
}
