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 mod = 1e9 + 7;
const int maxn = 1e5 + 5;
bitset<maxn> f[26], w;
char s[maxn], p[maxn];
int main() {
  int n, q, op, i, j, k;
  scanf("%s", s);
  n = strlen(s);
  for (i = 0; i < n; i++) f[s[i] - 'a'][i] = 1;
  scanf("%d", &q);
  while (q--) {
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d %s", &i, p);
      i--;
      f[s[i] - 'a'][i] = 0;
      s[i] = p[0];
      f[s[i] - 'a'][i] = 1;
    } else {
      scanf("%d%d %s", &i, &j, p);
      n = strlen(p);
      if (i + n - 1 > j) {
        puts("0");
        continue;
      }
      w = f[p[0] - 'a'];
      for (k = 1; k < n; k++) w &= f[p[k] - 'a'] >> k;
      printf("%d\n",
             (int)((w >> (i - 1)).count() - (w >> (j - n + 1)).count()));
    }
  }
  return 0;
}
