unknown bug :http://www.codechef.com/problems/CVOTE

http://www.codechef.com/problems/CVOTE
hello i am a newbie to STL and was trying out the above question.
can somebody tell me what is wrong in my code .i tried printing out some executions and found out that first time cin>>chef is not working?c
heres my code:
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s,chef,country;
long m,n;
map<string,pair<string,int> > participant;
scanf("%d,%d",&n,&m);
while(n–)
{
cin>>chef;
cin>>country;
participant[chef].first=country;
participant[chef].second=0;
}

while(m--)
{
	cin>>s;
	participant[s].second++;
} 
map<string,pair<string,int> > :: iterator ctry=participant.begin();
map<string,pair<string,int> > :: iterator chf=ctry;
for(map<string,pair<string,int> > :: iterator it = participant.begin();it!=participant.end();++it)
{
	if(it->second.second>chf->second.second)//find the one with greatest vote
	{
		chf=it;
		ctry=it;
	}
	else if(it->second.second=chf->second.second)//both have same votes
	{
		if(it->second.first<ctry->second.first)//comparing lexorgaphical order of countries
		{
			ctry=it;
		}
		//no need for doing same for chefs as keys in map are already on lexographical order
	}
}
cout<<ctry->second.first<<endl;
cout<<chf->first<<endl;
return 0;

}