#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, q, l, r, tlen, cnt;
  char s[N], t[N];
  bool match[N] = {0};
  cin >> n >> m >> q >> s >> t;
  tlen = strlen(t);
  for (int i = 0; s[i]; ++i) {
    match[i] = !strncmp(s + i, t, tlen);
  }
  while (q-- > 0) {
    cin >> l >> r;
    --l;
    --r;
    cnt = 0;
    for (int i = l; i <= r - tlen + 1; ++i) {
      cnt += match[i];
    }
    cout << cnt << "\n";
  }
  return 0;
}
