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 maxn = 1e5 + 10;
char s[maxn];
bitset<maxn> a[26], b;
int main() {
  int T;
  scanf("%s%d", s, &T);
  int ls = strlen(s);
  for (int i = 0; i < ls; i++) a[s[i] - 'a'][i] = 1;
  while (T--) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int pos;
      char ch;
      cin >> pos >> ch;
      a[s[pos - 1] - 'a'][pos - 1] = 0;
      a[ch - 'a'][pos - 1] = 1;
      s[pos - 1] = ch;
    } else {
      int l, r;
      char ss[maxn];
      scanf("%d%d%s", &l, &r, ss);
      b.set();
      int lss = strlen(ss);
      for (int i = 0; i < lss; i++) b &= a[ss[i] - 'a'] >> i;
      int ans = 0;
      int ln = (b >> l - 1).count();
      int rn = (b >> r - lss + 1).count();
      ans = ln - rn;
      if (ans < 0) ans = 0;
      cout << ans << endl;
    }
  }
  return 0;
}
