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<100015> a[27], ans;
char s[100005], ch[100005];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  for (int i = 1; i <= n; ++i) a[s[i] - 'a'].set(i);
  int m;
  scanf("%d", &m);
  int kind, l, r, x;
  char y;
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &kind);
    switch (kind) {
      case 1:
        scanf("%d %c", &x, &y);
        a[s[x] - 'a'].reset(x);
        s[x] = y;
        a[s[x] - 'a'].set(x);
        break;
      case 2:
        scanf("%d%d%s", &l, &r, ch + 1);
        ans.set();
        int len = strlen(ch + 1);
        if (r - l + 1 < len) {
          puts("0");
          continue;
        }
        for (int i = 1; i <= len; ++i) {
          ans &= a[ch[i] - 'a'] >> i;
        }
        printf("%d\n",
               (ans >> (l - 1)).count() - (ans >> (r - len + 1)).count());
        break;
    }
  }
}
