#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
char str[maxn], s[maxn];
struct node {
  char ch;
  int val;
  node() {}
  node(char _ch, int _val) : ch(_ch), val(_val) {}
};
node stk[maxn];
int top;
int f[maxn];
int tr[maxn];
int len1, len2;
void update(int x, int v) {
  while (x <= len1) {
    tr[x] += v;
    x += (x & (-x));
  }
}
int get_sum(int x) {
  int ans = 0;
  while (x > 0) {
    ans += tr[x];
    x -= (x & (-x));
  }
  return ans;
}
int fail[maxn];
void getFail(char* P, int len) {
  fail[0] = fail[1] = 0;
  for (int i = 1; i < len; i++) {
    int j = fail[i];
    while (j && P[i] != P[j]) j = fail[j];
    fail[i + 1] = (P[i] == P[j] ? j + 1 : 0);
  }
}
int main() {
  int m;
  scanf("%d %d %d", &len1, &len2, &m);
  scanf(" %s", str);
  scanf(" %s", s);
  getFail(s, len2);
  int j = 0;
  for (int i = 0; i < len1; i++) {
    while (j && s[j] != str[i]) j = fail[j];
    if (s[j] == str[i]) ++j;
    if (j == len2) {
      int x = i - len2 + 1;
      update(x + 1, 1);
    }
  }
  for (int i = 0; i < m; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    if (r - l + 1 < len2) {
      printf("0\n");
    } else {
      printf("%d\n", get_sum(r - len2 + 1) - get_sum(l - 1));
    }
  }
  return 0;
}
