#include <bits/stdc++.h>
using namespace std;
char s[1005], t[1005];
int n, m, q;
int c[1005];
int main() {
  scanf("%d%d%d", &n, &m, &q);
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (int i = 1; i <= n; i++) {
    c[i] = c[i - 1];
    int d = 1;
    for (int j = 1; j <= m; j++) {
      if (s[i + j - 1] != t[j]) d = 0;
    }
    c[i] += d;
  }
  for (int i = 0; i < q; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    if (r - m + 1 <= l - 1) {
      puts("0");
      continue;
    }
    printf("%d\n", c[r - m + 1] - c[l - 1]);
  }
  return 0;
}
