#include <bits/stdc++.h>
using namespace std;
const int desll[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
const long long mod = 1e9 + 7;
const int maxn = 1e6 + 7;
const int maxm = 1e8 + 7;
const double eps = 1e-4;
int m, n;
int ar[maxn];
char ch1[maxn], ch2[maxn];
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  int q;
  scanf("%d", &q);
  scanf("%s", ch1 + 1);
  scanf("%s", ch2 + 1);
  memset(ar, 0, sizeof(ar));
  for (int i = 1; i <= (n - m + 1); i++) {
    int ins = 1;
    for (int j = 1; j <= m; j++) {
      if (ch1[i + j - 1] != ch2[j]) {
        ins = 0;
        break;
      }
    }
    ar[i] = ar[i - 1] + ins;
  }
  for (int i = n - m + 2; i <= n; i++) {
    ar[i] = ar[i - 1];
  }
  while (q--) {
    int a, b;
    scanf("%d", &a);
    scanf("%d", &b);
    int ins = ar[b - m + 1] - ar[a - 1];
    if (ins < 0) ins = 0;
    printf("%d\n", ins);
  }
  return 0;
}
