#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 1e5 + 5;
char s[MAXN], t[MAXN];
int nxt[MAXN], sum[MAXN];
int N, M, Q;
int main() {
  N = read();
  M = read();
  Q = read();
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int j = 0;
  for (int i = 2; i <= M; i++) {
    while (j && t[i] != t[j + 1]) j = nxt[j];
    if (t[i] == t[j + 1]) j++;
    nxt[i] = j;
  }
  j = 0;
  for (int i = 1; i <= N; i++) {
    while (j && s[i] != t[j + 1]) j = nxt[j];
    if (s[i] == t[j + 1]) j++;
    if (j == M) sum[i]++, j = nxt[j];
  }
  for (int i = 1; i <= N; i++) sum[i] += sum[i - 1];
  while (Q--) {
    int l = read(), r = read();
    l += M - 1;
    if (l > r)
      puts("0");
    else
      printf("%d\n", sum[r] - sum[l - 1]);
  }
  return 0;
}
