#include <bits/stdc++.h>
int n, m, q, a0, a1;
char s[1003], t[1003];
int pp[1003];
int main() {
  scanf("%d %d %d", &n, &m, &q);
  scanf("%s", s);
  scanf("%s", t);
  for (int i = 0; i <= n - m; ++i) {
    int j = 0;
    for (; j < m && s[i + j] == t[j]; ++j)
      ;
    if (j == m) pp[i] = 1;
  }
  for (int i = 1; i <= n - m; ++i) pp[i] += pp[i - 1];
  for (int i = 0; i < q; ++i) {
    scanf("%d %d", &a0, &a1);
    a0--;
    a1--;
    if (a0 + m - 1 <= a1) {
      if (a0 > 0)
        printf("%d\n", pp[a1 - m + 1] - pp[a0 - 1]);
      else
        printf("%d\n", pp[a1 - m + 1]);
    } else
      printf("0\n");
  }
  return 0;
}
