#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 30;
int n, m;
set<pair<int, int> > syx, sxy;
pair<int, int> ip[20];
struct Seg {
  static const int xb = N - 5;
  int f[N << 1];
  inline void Chg(int x, int y) {
    f[xb + x] = y;
    for (int i = (xb + x) >> 1; i; i >>= 1)
      f[i] = max(f[i << 1], f[i << 1 | 1]);
  }
  inline int Ask(int x, int y) {
    int ans = 0;
    for (int l = xb + x - 1, r = xb + y + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
      if (~l & 1) ans = max(ans, f[l ^ 1]);
      if (r & 1) ans = max(ans, f[r ^ 1]);
    }
    return ans;
  }
} Tx, Ty;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, opt, x, y; i <= m; ++i) {
    scanf("%d", &opt);
    if (opt == 1) {
      scanf("%d%d", &x, &y);
      y = y + m - i;
      int tot = 0;
      for (set<pair<int, int> >::iterator it = syx.begin(); it != syx.end();
           ++it) {
        if (it->first > y) break;
        ip[++tot] = pair<int, int>(it->second, it->first);
        Tx.Chg(ip[tot].first, 0);
      }
      syx.insert(pair<int, int>(y, x));
      sxy.insert(pair<int, int>(x, y));
      ip[++tot] = pair<int, int>(x, y);
      for (int i = tot; i; --i) {
        int ans = Tx.Ask(ip[i].first, n) + 1;
        Tx.Chg(ip[i].first, ans);
        Ty.Chg(ip[i].second, ans);
      }
    } else {
      scanf("%d", &x);
      int tot = 0;
      for (set<pair<int, int> >::iterator it = sxy.begin(); x--; ++it) {
        ip[++tot] = *it;
        Ty.Chg(ip[tot].second, 0);
      }
      sxy.erase(ip[tot]);
      syx.erase(pair<int, int>(ip[tot].second, ip[tot].first));
      Tx.Chg(ip[tot].first, 0);
      --tot;
      for (int i = tot; i; --i) {
        int ans = Ty.Ask(ip[i].second, m + 10) + 1;
        Tx.Chg(ip[i].first, ans);
        Ty.Chg(ip[i].second, ans);
      }
    }
    printf("%d\n", Tx.Ask(1, m + 10));
  }
  return 0;
}
