#include using namespace std; #define all(x) (x).begin(), (x).end() int main() { int N, Q; cin >> N >> Q; vector> cnt(2); int ans = 0; vector> A = { {1, 5, 7, 11}, {1, 11, 19, 29} }; auto f = [&](int s, int d) -> void { for (int i : {0, 1}) { for (int b : A[i]) { if (s % b == 0) { ans -= (cnt[i][s/b] == 4); cnt[i][s/b] += d; ans += (cnt[i][s/b] == 4); } } } }; for (int i = 0; i < N; i++) { int s; cin >> s; f(s, 1); } while(Q--) { int q, s; cin >> q >> s; int t = (q == 1? 1 : -1); f(s, t); cout << ans << endl; } }