#include <stdio.h>
#include <stdlib.h>
#include <string.h>



int count_char(char *s, char target) {
    // TODO: implement this function
    return 0;
}


int main(void) {
    char s[1000];
    if (fgets(s, sizeof s, stdin) == NULL) { s[0] = '\0'; }
    s[strcspn(s, "\n")] = '\0';
    char t[100];
    if (fgets(t, sizeof t, stdin) == NULL) { t[0] = '\0'; }
    t[strcspn(t, "\n")] = '\0';
    char target = t[0];
    printf("%d\n", count_char(s, target));
    return 0;
}
