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("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int arr = 2e5 + 10;
const int ar = 2e3 + 10;
const long double pi = acos(-1);
const long double eps = 1e-10;
const long long md = 1e9 + 7;
const int buf_size = 4096;
static unsigned char buf[buf_size];
int buf_pos, buf_len;
inline bool is_eof() {
  if (buf_pos == buf_len) {
    buf_pos = 0;
    buf_len = fread(buf, 1, buf_size, stdin);
    if (buf_len == 0) {
      return 1;
    }
  }
  return 0;
}
inline int get_char() { return is_eof() ? -1 : buf[buf_pos++]; }
inline int read_char() {
  char c = get_char();
  while (c != -1 && c <= 32) {
    c = get_char();
  }
  return c;
}
inline int read_int() {
  int m = 1;
  int x = 0;
  char c = read_char();
  if (c == '-') {
    m = -1;
    c = get_char();
  } else if (c == '+') {
    c = get_char();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + (c - '0');
    c = get_char();
  }
  return x * m;
}
char s[arr];
char t[arr];
int sz;
void read_t() {
  sz = 0;
  char c = read_char();
  while (c != -1 && c > 32) {
    t[sz++] = c;
    c = get_char();
  }
}
int main() {
  read_t();
  int n = sz;
  for (int i = 0; i < n; i++) {
    s[i] = t[i];
  }
  int q;
  q = read_int();
  while (q--) {
    int type;
    type = read_int();
    if (type == 1) {
      int id;
      char c;
      id = read_int();
      id--;
      c = read_char();
      s[id] = c;
    } else {
      int l, r;
      l = read_int();
      r = read_int();
      l--;
      r--;
      read_t();
      int n = r - l + 1;
      n = n - sz + 1;
      int ans = 0;
      for (int i = 0; i < n; i++) {
        char* ss = s + l + i;
        bool ok = 1;
        int curr = sz;
        while (curr % 4 != 0) {
          if (ss[curr - 1] != t[curr - 1]) {
            ok = 0;
          }
          curr--;
        }
        if (ok) {
          int* sss = (int*)ss;
          int* ttt = (int*)t;
          for (int j = 0; j < curr / 4; j++) {
            if (sss != ttt) {
              ok = 0;
              break;
            }
            sss++;
            ttt++;
          }
        }
        if (ok) {
          ans++;
        }
      }
      cout << ans << "\n";
    }
  }
}
