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>
#pragma GCC optimize(2)
const int MAXN = 1e5 + 19;
std::bitset<MAXN> myBit[26], ans;
int q, len;
char str[MAXN], s[MAXN];
int opt, x, l, r;
int main() {
  std::scanf("%s%d", str + 1, &q);
  len = std::strlen(str + 1);
  for (int i = 1; i <= len; ++i) myBit[str[i] - 'a'][i] = 1;
  while (q--) {
    std::scanf("%d", &opt);
    if (opt == 1) {
      std::scanf("%d%s", &x, s + 1);
      myBit[str[x] - 'a'][x] = 0;
      str[x] = s[1];
      myBit[str[x] - 'a'][x] = 1;
    } else if (opt == 2) {
      std::scanf("%d%d%s", &l, &r, s + 1);
      len = std::strlen(s + 1);
      ans.set();
      for (int i = 1; i <= len; ++i) ans &= myBit[s[i] - 'a'] >> (i - 1);
      r = r - len + 1;
      std::printf("%lld\n", (ans >> l).count() - (ans >> (r + 1)).count());
    }
  }
  return 0;
}
