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 = 1e5 + 10;
char s[N], ss[N];
int n;
bitset<N> a[30], ans;
int main() {
  scanf("%s", s);
  int len = strlen(s);
  for (int i = 0; i < len; i++) a[s[i] - 'a'][i] = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int ty;
    scanf("%d", &ty);
    if (ty == 1) {
      int x;
      scanf("%d", &x);
      x--;
      char c[2];
      scanf("%s", c);
      a[s[x] - 'a'][x] = 0;
      s[x] = c[0];
      a[s[x] - 'a'][x] = 1;
    } else {
      int l, r;
      scanf("%d%d", &l, &r);
      scanf("%s", ss);
      int len_ = strlen(ss);
      ans.set();
      for (int j = 0; j < len_; j++) ans &= (a[ss[j] - 'a'] >> j);
      printf("%d\n",
             (ans >> (l - 1)).count() - (ans >> (r - len_ + 1)).count());
    }
  }
}
