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 = 100010;
int n, q;
char s[N], c[N];
bitset<N> a[26], ans;
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < n; i++) a[s[i] - 'a'][i] = 1;
  scanf("%d", &q);
  while (q--) {
    int op, x, y;
    scanf("%d%d", &op, &x);
    if (op == 1) {
      scanf("%s", c);
      a[s[x - 1] - 'a'][x - 1] = 0;
      a[(s[x - 1] = c[0]) - 'a'][x - 1] = 1;
    } else {
      ans.set();
      scanf("%d%s", &y, c);
      int len = strlen(c);
      for (int i = 0; i < len; i++) ans &= a[c[i] - 'a'] >> i;
      printf("%d\n", (ans >> (x - 1)).count() - (ans >> (y - len + 1)).count());
    }
  }
  return 0;
}
