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 maxn = (int)(1e5) + 5;
char s[maxn], t[maxn];
bitset<maxn> c[26];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1), q;
  for (int i = 1; i <= n; ++i) c[s[i] - 'a'].set(i);
  scanf("%d", &q);
  for (int i = 1; i <= q; ++i) {
    int opt;
    scanf("%d", &opt);
    if (opt == 1) {
      int x;
      scanf("%d%s", &x, t);
      c[s[x] - 'a'].reset(x);
      c[(s[x] = t[0]) - 'a'].set(x);
    } else {
      int l, r;
      scanf("%d%d%s", &l, &r, t);
      int m = strlen(t);
      bitset<maxn> ret;
      ret.set();
      for (int j = 0; j < m; ++j) ret &= (c[t[j] - 'a'] >> j);
      ret = (ret >> l) << l;
      ret = (ret << (maxn - r + m - 2)) >> (maxn - r + m - 2);
      printf("%u\n", ret.count());
    }
  }
}
