#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
set<int> dp[100010], pos;
set<pair<int, int> > key;
int n, m, f[100010], a[100010], x, y, opt;
int tmp[100010];
bool check(int x, int val) {
  set<int>::iterator it = dp[val].upper_bound(x);
  return it != dp[val].end() && a[*it] > a[x];
}
int main() {
  n = read();
  m = read();
  n++;
  a[1] = -10000000;
  f[1] = 1;
  dp[1].insert(1);
  pos.insert(1);
  key.insert(make_pair(-10000000, 1));
  for (int i = 1; i <= m; i++) {
    opt = read();
    if (opt == 1) {
      x = read();
      y = read();
      x++;
      a[x] = y - i;
      int tot = 0;
      for (set<pair<int, int> >::iterator it = key.begin();
           it != key.end() && it->first < a[x]; ++it)
        if (it->second < x) {
          tot++;
          tmp[tot] = it->second;
        }
      key.insert(make_pair(a[x], x));
      pos.insert(x);
      int l = 1, r = f[1];
      while (l < r) {
        int mid = (l + r) >> 1;
        if (check(x, mid))
          l = mid + 1;
        else
          r = mid;
      }
      f[x] = l;
      dp[l].insert(x);
      sort(tmp + 1, tmp + tot + 1);
      for (int j = tot; j >= 1; --j)
        if (check(tmp[j], f[tmp[j]])) {
          dp[f[tmp[j]]].erase(tmp[j]);
          dp[++f[tmp[j]]].insert(tmp[j]);
        }
    } else {
      x = read();
      set<int>::iterator it = pos.begin();
      int tot = 0;
      for (int j = 1; j <= x; ++j, ++it) tmp[++tot] = *it;
      int p = a[*it];
      dp[f[*it]].erase(*it);
      key.erase(make_pair(a[*it], *it));
      pos.erase(it);
      for (int j = tot; j >= 1; --j)
        if (a[tmp[j]] < p && !check(tmp[j], f[tmp[j]] - 1)) {
          dp[f[tmp[j]]].erase(tmp[j]);
          dp[--f[tmp[j]]].insert(tmp[j]);
        }
    }
    printf("%d\n", f[1] - 1);
  }
  return 0;
}
