#include <bits/stdc++.h>
using namespace std;
int n, m, q;
int ans[1005];
int main() {
  while (scanf("%d%d%d", &n, &m, &q) != EOF) {
    string s1, s2;
    cin >> s1 >> s2;
    for (int i = 0; i + m <= n; i++) {
      if (s1.substr(i, m) == s2) ans[i + 1]++;
    }
    for (int i = 2; i <= n; i++) ans[i] += ans[i - 1];
    while (q--) {
      int li, ri;
      scanf("%d%d", &li, &ri);
      ri = ri - m + 1;
      printf("%d\n", max(0, ans[max(0, ri)] - ans[li - 1]));
    }
  }
}
