#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, q;
  scanf("%lld", &n), scanf("%lld", &m), scanf("%lld", &q);
  string s, t;
  cin >> s >> t;
  long long cs[n + 10];
  cs[0] = 0;
  memset(cs, 0, sizeof cs);
  for (long long i = 0; i < n; i++) {
    bool f = true;
    if (n < m) {
      cs[i + 1] = 0;
      continue;
    }
    for (long long j = i, k = 0; j < n and k < m; j++, k++) {
      if (s[j] != t[k]) {
        f = false;
      }
    }
    if (f) {
      cs[i + 1] = cs[i] + 1;
    } else {
      cs[i + 1] = cs[i];
    }
  }
  long long l, r;
  while (q--) {
    scanf("%lld", &l), scanf("%lld", &r);
    r = r - m + 1;
    if (l > r) {
      printf("0\n");
      continue;
    }
    printf("%lld\n", cs[r] - cs[l - 1]);
  }
}
