#include <bits/stdc++.h>
using namespace std;
int n, m, q;
const int maxn = 1005;
char s[maxn], t[maxn];
int sum[maxn];
int main() {
  scanf("%d%d%d", &n, &m, &q);
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (int i = 1; i <= n - m + 1; i++) {
    bool f = 1;
    for (int j = 1; j <= m; j++)
      if (s[i + j - 1] != t[j]) f = 0;
    if (f == 1) sum[i] = 1;
  }
  for (int i = 1; i <= n; i++) sum[i] += sum[i - 1];
  for (int i = 1; i <= q; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    printf("%d\n",
           max(0, (r >= m ? sum[r - m + 1] : 0) - (l >= 1 ? sum[l - 1] : 0)));
  }
  return 0;
}
