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 = 100100;
int m, o, l, r;
char s[N], t[N];
bitset<N> x[30], ans, one;
int main() {
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 0; i < n; i++) {
    int ch = s[i] - 'a';
    x[ch][i + 1] = 1;
  }
  scanf("%d", &m);
  for (int i = 0; i < n; i++) {
    one[i] = 1;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &o);
    if (o == 1) {
      scanf("%d %s", &l, t);
      l--;
      x[s[l] - 'a'][l + 1] = 0;
      s[l] = t[0];
      x[s[l] - 'a'][l + 1] = 1;
    } else if (o == 2) {
      scanf("%d %d %s", &l, &r, t);
      int len = strlen(t);
      if (r - l + 1 < len) {
        puts("0");
        continue;
      }
      ans = one;
      for (int j = 0; j < len; j++) {
        int ch = t[j] - 'a';
        ans &= (x[ch] >> (j + 1));
      }
      int w = (ans >> (l - 1)).count() - (ans >> (r - len + 1)).count();
      printf("%d\n", w);
    }
  }
  return 0;
}
