#include<iostream> #include<map> using namespace std; map<char, int> char2num; int main(){ char a; char c; for(int i=0;i<500;i++){ cin.get(c); if (c == '\n') break; else if(c <= 'Z' && c >= 'A'){ if(char2num.find(c) == char2num.end()) char2num[c] = 1; else char2num[c] ++; } else if(c <= 'z' && c >= 'a'){ if(char2num.find(c-32) == char2num.end()) char2num[c-32] = 1; else char2num[c-32] ++; }else{} } cin>>a; if(a <= 'Z' && a >= 'A'){ // 大写 if(char2num.find(a) != char2num.end()){ cout<<char2num[a]; }else cout<<0; }else{ // 小写 if(char2num.find(a-32) != char2num.end()){ cout<<char2num[a]+char2num[a-32]; }else cout<<0; } return 0; }