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>
const int N = 200005;
std::bitset<N> an, f[27];
int q, opt, l, r, pos;
char st[N], s[N], c;
int main() {
  scanf("%s", st + 1);
  int n = strlen(st + 1);
  for (int i = 1; i <= n; i++) f[st[i] - 'a'][i] = 1;
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    scanf("%d", &opt);
    if (opt == 1) {
      scanf("%d %c", &pos, &c);
      f[st[pos] - 'a'][pos] = 0;
      f[c - 'a'][pos] = 1;
      st[pos] = c;
    } else {
      scanf("%d%d%s", &l, &r, s + 1);
      an.set();
      int len = strlen(s + 1);
      for (int j = 1; j <= len; j++) an &= f[s[j] - 'a'] >> (j - 1);
      int anl = (an >> l).count(), anr = (an >> (r - len + 2)).count();
      printf("%d\n", anl - anr);
    }
  }
  return 0;
}
