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