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;
int n;
char s[100005] = {0};
bitset<100005> a[27], b;
int main() {
  scanf("%s", s);
  int len = strlen(s);
  for (int i = 0; i < len; i++) {
    if (s[i] >= 'a' && s[i] <= 'z') a[s[i] - 'a'][i + 1] = 1;
  }
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int x;
      char c;
      scanf("%d %c", &x, &c);
      a[s[x - 1] - 'a'][x] = 0;
      a[c - 'a'][x] = 1;
      s[x - 1] = c;
    } else if (op == 2) {
      int l, r;
      char s2[100005] = {0};
      scanf("%d %d %s", &l, &r, s2);
      b.set();
      int len1 = strlen(s2);
      for (int j = 0; j < len1; j++) b &= (a[s2[j] - 'a'] >> j);
      int ans1 = (b >> (l)).count();
      int ans2 = (b >> (r - len1 + 2)).count();
      if (ans1 - ans2 < 0) ans1 = ans2;
      printf("%d\n", ans1 - ans2);
    }
  }
  return 0;
}
