#include <stdio.h>
#include <stdlib.h>
int main() {
char *s = NULL, c, p;
int len = 0, buff = 0, count = 0; // p is pair to c
len = getline(&s, &buff, stdin);
if(scanf(" %c", &c) != 1) return 0;
if(65 <= c && c <= 90) {
p = c + 32;
} else if (97 <= c && c <= 122) {
p = c - 32;
} else {
p = c;
}
len--;
for(int i = 0; i < len; i++) {
if(s[i] == c || s[i] == p) count++;
}
printf("%d", count);
return 0;
}



京公网安备 11010502036488号