#include int main() { int count = 0; int min, max; char target; char str[100]; while (scanf("%d-%d %c: %s", &min, &max, &target, str) == 4) { int char_count = 0; char *str_ptr = str; char test_c; while ((test_c = *(str_ptr++)) != '\0') { if (test_c == target) char_count++; } if (min <= char_count && char_count <= max){ count++; } } printf("%d\n", count); return 0; }