#include <cstdio> #include <cstring> using namespace std; int main(){ int arr[256]; char ch; memset(arr, 0, sizeof(arr)); while (true) { scanf("%c", &ch); if(ch == '\n'){ break; } else{ arr[ch]++; } } scanf("%c", &ch); if(ch >= 'A' && ch <= 'Z'){ printf("%d", arr[ch] + arr[ch-'A'+'a']); } else if(ch >= 'a' && ch <= 'z'){ printf("%d", arr[ch] + arr[ch-'a'+'A']); } else{ printf("%d", arr[ch]); } return 0; }