include [HTML_REMOVED]
using namespace std;
const int N = 100010;
map[HTML_REMOVED] str;
char s[N];
int main(){
int n;
scanf(“%d”,&n);
while(n–){
char op[2];
scanf(“%s%s”,op,s);
if(*op==’I’)
str[s]++;
else printf(“%d\n”,str[s]);
}
}