#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 100000;
const int M_MAX = 200000;
const int XY_MAX = 200010;
int n, m;
int SGTx[XY_MAX * 4 + 2];
int SGTy[XY_MAX * 4 + 2];
void update(int SGT[], int node, int l, int r, int upos, int uval) {
  if (l == r) {
    SGT[node] = uval;
    return;
  }
  int mid = ((l + r) >> 1), lSon = (node << 1), rSon = (lSon | 1);
  if (upos <= mid)
    update(SGT, lSon, l, mid, upos, uval);
  else
    update(SGT, rSon, mid + 1, r, upos, uval);
  SGT[node] = max(SGT[lSon], SGT[rSon]);
}
int query(int SGT[], int node, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) return SGT[node];
  int mid = ((l + r) >> 1), lSon = (node << 1), rSon = (lSon | 1);
  if (ql <= mid && mid + 1 <= qr)
    return max(query(SGT, lSon, l, mid, ql, qr),
               query(SGT, rSon, mid + 1, r, ql, qr));
  else if (ql <= mid)
    return query(SGT, lSon, l, mid, ql, qr);
  else
    return query(SGT, rSon, mid + 1, r, ql, qr);
}
set<pair<int, int>> sx;
set<pair<int, int>> sy;
void plant(int x, int y) {
  for (set<pair<int, int>>::iterator it = sy.begin();
       it != sy.end() && it->first <= y; it++) {
    update(SGTx, 1, 1, XY_MAX, it->second, 0);
    update(SGTy, 1, 1, XY_MAX, it->first, 0);
  }
  sy.insert(make_pair(y, x));
  sx.insert(make_pair(x, y));
  set<pair<int, int>>::iterator it = sy.find(make_pair(y, x));
  while (true) {
    int val = query(SGTx, 1, 1, XY_MAX, it->second, XY_MAX) + 1;
    update(SGTx, 1, 1, XY_MAX, it->second, val);
    update(SGTy, 1, 1, XY_MAX, it->first, val);
    if (it == sy.begin()) return;
    it--;
  }
}
void cut(int k) {
  set<pair<int, int>>::iterator aux = sx.begin();
  for (int i = 1; i < k; i++) aux++;
  int x = aux->first, y = aux->second;
  for (set<pair<int, int>>::iterator it = sx.begin();
       it != sx.end() && it->first <= x; it++) {
    update(SGTy, 1, 1, XY_MAX, it->second, 0);
    update(SGTx, 1, 1, XY_MAX, it->first, 0);
  }
  sx.erase(make_pair(x, y));
  sy.erase(make_pair(y, x));
  set<pair<int, int>>::iterator it = sx.upper_bound(make_pair(x, y));
  while (true) {
    if (it == sx.begin()) return;
    it--;
    int val = query(SGTy, 1, 1, XY_MAX, it->second, XY_MAX) + 1;
    update(SGTy, 1, 1, XY_MAX, it->second, val);
    update(SGTx, 1, 1, XY_MAX, it->first, val);
  }
}
int getLIS() { return SGTx[1]; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int type;
    cin >> type;
    if (type == 1) {
      int x, y;
      cin >> x >> y;
      y = y + m - i;
      plant(x, y);
    } else {
      int k;
      cin >> k;
      cut(k);
    }
    cout << getLIS() << "\n";
  }
  return 0;
}
