#include <stdio.h> #include <string.h> int main(void) { char str[1000]; char a, b; int count = 0; gets(str); scanf("%c", &a); if (('A' <= a) && (a <= 'Z')) b = a - 'A' + 'a'; else if (('a' <= a) && (a <= 'z')) b = a - 'a' + 'A'; else b = a; for (int i = 0; i < strlen(str); i++) if ((str[i] == a) || (str[i] == b)) count++; printf("%d", count); return 0; }