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