#include <bits/stdc++.h>
using namespace std;
const int inf = 0, mod = 1000000007;
const double pi = 3.1415926535897932, eps = 1e-6;
void chmax(int &x, int y) {
  if (x < y) x = y;
}
void chmin(int &x, int y) {
  if (x > y) x = y;
}
int qpow(int x, int y) {
  int ret = 1;
  while (y) {
    if (y & 1) ret = (long long)ret * x % mod;
    x = (long long)x * x % mod;
    y >>= 1;
  }
  return ret;
}
struct BIT {
  int n, t[1000005], lg;
  void pre(int nn) {
    n = nn;
    while ((1 << lg) < n) lg++;
  }
  void update(int x, int y) {
    while (x <= n) {
      t[x] += y;
      x += x & (-x);
    }
  }
  int get(int x) {
    int res = 0;
    while (x) {
      res += t[x];
      x -= x & (-x);
    }
    return res;
  }
  int find(int x) {
    int res = 0;
    for (int(i) = (lg); (i) >= (0); (i)--) {
      if (res + (1 << i) > n) continue;
      int cur = t[res + (1 << i)];
      if (x > cur) {
        res += 1 << i;
        x -= cur;
      }
    }
    return res + 1;
  }
} tr;
struct segtree {
  int dat[1048580], n;
  void build(int nn) {
    n = 1;
    while (n <= nn) n <<= 1;
    for (int i = 0; i < 2 * n - 1; i++) dat[i] = 0;
  }
  void update(int k, int a) {
    k += n - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = max(dat[(k << 1) + 1], dat[(k << 1) + 2]);
    }
  }
  int query(int l, int r) {
    if (l == 0) return 0;
    return query(l, r + 1, 0, 0, n);
  }
  int query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) return 0;
    if (a <= l && r <= b) return dat[k];
    return max(query(a, b, (k << 1) + 1, l, (l + r) >> 1),
               query(a, b, (k << 1) + 2, (l + r) >> 1, r));
  }
} seg, segp;
int n, m, dp[100005], t[100005];
set<pair<int, int> > s;
int offset, lft = 200005;
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = (1); (i) <= (n); (i)++) dp[i] = 0;
  tr.pre(100001);
  seg.build(200050);
  segp.build(n + 1);
  for (int(i) = (1); (i) <= (m); (i)++) {
    int typ;
    scanf("%d", &typ);
    if (typ == 1) {
      int p, h;
      scanf("%d%d", &p, &h);
      tr.update(p, 1);
      t[p] = h - offset + lft;
      set<pair<int, int> >::iterator it;
      for (it = s.begin(); it != s.end(); it++) {
        if (it->first < t[p] - lft) {
          seg.update(it->first + lft, 0);
          segp.update(it->second, 0);
        } else
          break;
      }
      dp[p] = max(segp.query(p + 1, n) + 1, 1);
      seg.update(t[p], dp[p]);
      segp.update(p, dp[p]);
      if (it != s.begin()) {
        it--;
        for (;; it--) {
          if (it->first < t[p] - lft) {
            dp[it->second] = max(segp.query(it->second + 1, n) + 1, 1);
            seg.update(it->first + lft, dp[it->second]);
            segp.update(it->second, dp[it->second]);
          }
          if (it == s.begin()) break;
        }
      }
      s.insert(make_pair(t[p] - lft, p));
    }
    if (typ == 2) {
      int p;
      scanf("%d", &p);
      int pp = tr.find(p);
      for (int(i) = (p); (i) >= (1); (i)--)
        dp[tr.find(i)] = 0, seg.update(t[tr.find(i)], 0),
        segp.update(tr.find(i), 0);
      tr.update(pp, -1);
      s.erase(make_pair(t[pp] - lft, pp));
      t[pp] = 0;
      for (int(i) = (p - 1); (i) >= (1); (i)--) {
        int x = tr.find(i);
        dp[x] = max(seg.query(t[x] + 1, 200049) + 1, 1);
        seg.update(t[x], dp[x]);
        segp.update(x, dp[x]);
      }
    }
    printf("%d\n", seg.query(1, 200049));
    offset++;
  }
  return 0;
}
