WA in TWTCLOSE

c-plus-plus
twtclose
wa

#1

#include
#include

using namespace std;

int main()
{
	int n,k,count=0;
	string input;
	cin>>n>>k;
	cin.ignore();

	int tweet[1000];
	memset(tweet, -1, sizeof(tweet));
	for(int j=0;j<k;j++)
	{
		
		getline(cin,input);
		
		if(input=="CLOSEALL")
		{
			memset(tweet, -1, sizeof(tweet));
		}
		else
		{
			
			int index = input[6]-'0';
			tweet[index-1] *= -1;
		}
		for(int m=0;m<n;m++)
		{
			if(tweet[m]==1)
				count += 1;
		}
		cout<<count<<endl;
		count = 0;
	}
	return 0;
}

This returns WA for the question TWTCLOSE. Why?