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