problem code TWTCLOSE
#include
#include<string.h>
using namespace std;
int main() {
int n,k,nop=0,x,y;
string str;
int a[1010];
cin>>n>>k;
cin.ignore();
while(k--)
{
getline(cin,str);
nop=0;
if(str=="CLOSEALL")
{
for(int i=0;i<=n;i++)
a[i]=0;
}
else
{
x=0;
for(int i=0;i<str.length();i++)
{
if(str[i]>=48&&str[i]<=60)
{
y=str[i]-48 ;
x=x*10+y;
}
}
a[x]=!a[x];
}
for(int i=0;i<=n;i++)
{ if(a[i]==1)
nop++;
}
cout<<nop<<endl;
}
return 0;
}