#include <bits/stdc++.h>
using namespace std;
;
const double eps = 1e-8;
const int mod = 10007;
const int maxn = 1e6 + 7;
const double pi = acos(-1);
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f;
const unsigned long long p = 2333;
int n, m, q, l, r, ans;
unsigned long long hs[1007], ht, pw[1007];
char s[1007], t[1007];
void check(int l, int r) {
  ans = 0;
  for (int i = l; i <= r - m + 1; i++) {
    if (hs[i + m - 1] - hs[i - 1] * pw[m] == ht) {
      ans++;
    }
  }
}
int main() {
  pw[0] = 1;
  for (int i = 1; i < 1007; i++) {
    pw[i] = pw[i - 1] * p;
  }
  scanf("%d%d%d", &n, &m, &q);
  scanf("%s%s", s + 1, t + 1);
  hs[0] = 0, ht = 0;
  for (int i = 1; i <= n; i++) {
    hs[i] = hs[i - 1] * p + (s[i] - 'a' + 1);
  }
  for (int i = 1; i <= m; i++) {
    ht = ht * p + (t[i] - 'a' + 1);
  }
  while (q--) {
    scanf("%d%d", &l, &r);
    if (r - l + 1 < m) {
      printf("0\n");
      continue;
    }
    check(l, r);
    printf("%d\n", ans);
  }
  return 0;
}
