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;
bitset<100000> w[26];
bitset<100000> tmp;
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  string s;
  int q;
  cin >> s >> q;
  for (int i = 0; i < s.size(); ++i) w[s[i] - 'a'].set(i);
  for (int test = 0; test < q; ++test) {
    int type;
    cin >> type;
    if (type == 1) {
      int i;
      string c;
      cin >> i >> c;
      --i;
      w[s[i] - 'a'].reset(i);
      s[i] = c[0];
      w[s[i] - 'a'].set(i);
    } else {
      int l, r;
      string y;
      cin >> l >> r >> y;
      --l;
      r -= y.size();
      if (l > r) {
        cout << 0 << endl;
        continue;
      }
      tmp.set();
      for (int i = 0; i < y.size(); ++i) {
        tmp &= w[y[i] - 'a'] >> i;
      }
      tmp >>= l;
      tmp <<= l + 100000 - r - 1;
      int res = tmp.count();
      cout << res << endl;
    }
  }
  return 0;
}
