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 N = 100005;
bitset<N> b[26], all, ans, bas;
char s[N], t[N];
int n, Q;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = (int)(1); i <= (int)(n); i++) b[s[i] - 'a'][i] = 1;
  for (int i = (int)(1); i <= (int)(n); i++) all[i] = 1;
  scanf("%d", &Q);
  while (Q--) {
    int tp;
    scanf("%d", &tp);
    if (tp == 1) {
      int x;
      scanf("%d%s", &x, t + 1);
      b[s[x] - 'a'][x] = 0;
      b[(s[x] = t[1]) - 'a'][x] = 1;
    } else {
      int l, r;
      scanf("%d%d%s", &l, &r, t + 1);
      ans = bas = (all << (l - 1)) & (all >> (n - r));
      int len = strlen(t + 1);
      for (int i = (int)(1); i <= (int)(len); i++)
        ans &= (b[t[i] - 'a'] & bas) >> (i - 1);
      printf("%d\n", ans.count());
    }
  }
}
