abcdabcdab
5
2 2 8 ab
2 1 10 ab
1 3 a
1 4 b
2 1 4 ab

1
3
2

#include <bits/stdc++.h>
using namespace std;
const int EXP = 26;
const int DIM = 100005;
char str[DIM], aux[DIM];
bitset<DIM> bts[EXP], sol, one;
int main(void) {
  scanf("%s", str + 1);
  int n = (int)strlen(str + 1);
  for (int i = 1; i <= n; ++i) {
    bts[str[i] - 'a'][i] = true;
    one[i - 1] = true;
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int p;
      char ch;
      scanf("%d %c", &p, &ch);
      bts[str[p] - 'a'][p] = false;
      bts[ch - 'a'][p] = true;
      str[p] = ch;
    } else {
      int l, r;
      scanf("%d %d %s", &l, &r, aux + 1);
      int m = (int)strlen(aux + 1);
      if (m > r - l + 1)
        printf("%d\n", 0);
      else {
        sol = one;
        for (int i = 1; i <= m; ++i) sol &= (bts[aux[i] - 'a'] >> i);
        printf("%d\n", (int)(sol >> (l - 1)).count() -
                           (int)(sol >> (r - m + 1)).count());
      }
    }
  }
  return 0;
}
