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;
bitset<100001> bs[26], ba, bm;
char s[100001], t[100001];
int main(void) {
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 0; i != n; ++i) bs[s[i] - 'a'][i] = bm[i] = 1;
  int q;
  scanf("%d", &q);
  while (q--) {
    int o;
    scanf("%d", &o);
    if (o == 1) {
      int i;
      char b[10];
      scanf("%d%s", &i, b);
      i--;
      bs[s[i] - 'a'][i] = 0;
      s[i] = b[0];
      bs[s[i] - 'a'][i] = 1;
    } else {
      int l, r, m;
      scanf("%d%d%s", &l, &r, t);
      m = strlen(t);
      ba.set();
      for (int i = 0; i != m; ++i) {
        ba &= (bs[t[i] - 'a'] >> i);
      }
      ba >>= l - 1;
      ba <<= (n - (r - l - m + 2));
      ba &= bm;
      printf("%d\n", ba.count());
    }
  }
  return 0;
}
