#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
getline(cin, s); // 含空格的一行输入要用getline
char c, d;
cin >> c;
if (islower(c)) {
d = c - 'a' + 'A';
} else{
d = c - 'A' + 'a';
}
int ans = 0;
for (int i = 0; i < s.size(); ++i) {
if (s[i] == c || s[i] == d)
ans++;
}
cout << ans << endl;
return 0;
}

京公网安备 11010502036488号