#include <bits/stdc++.h>
using namespace std;
int n, m, q;
string str1, str2;
int ans[1005];
int main() {
  scanf("%d %d %d", &n, &m, &q);
  cin >> str1 >> str2;
  int f[1005];
  str1 = " " + str1;
  str2 = " " + str2;
  for (int i = 1; i <= n - m + 1; i++) {
    f[i] = 1;
    for (int j = 0; j < m; j++) {
      if (str1[i + j] != str2[j + 1]) {
        f[i] = 0;
        break;
      }
    }
    ans[i] = ans[i - 1] + f[i];
  }
  for (int i = 0; i < q; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    r = r - m + 1;
    if (r < l) {
      printf("0\n");
      continue;
    }
    printf("%d\n", ans[r] - ans[l - 1]);
  }
  return 0;
}
