#include <bits/stdc++.h>
using namespace std;
const int maxn = 10005;
int Next[maxn];
char str[maxn], th[maxn];
int change(char s[]) {
  int i = 0, j = 1;
  Next[i] = 0;
  while (s[j]) {
    if (s[i] == s[j]) {
      i++;
      Next[j] = i;
      j++;
    } else {
      if (i > 0) {
        i = Next[i - 1];
      } else {
        Next[j] = i;
        j++;
      }
    }
  }
  for (int i = j - 1; i > 0; i--) {
    Next[i] = Next[i - 1];
  }
  Next[0] = -1;
  return j;
}
int num[maxn] = {0};
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  scanf("%s%s", str, th);
  int l = change(th);
  int i = 0, j = 0, cnt = 0;
  while (str[i]) {
    if (str[i] == th[j]) {
      if (j == l - 1) {
        num[i - m + 1]++;
        cnt++;
        j = Next[j];
      } else {
        i++;
        j++;
      }
    } else {
      if (j >= 0) {
        j = Next[j];
      } else {
        i++;
        j = 0;
      }
    }
  }
  while (k--) {
    int l, r;
    scanf("%d%d", &l, &r);
    l--;
    r--;
    int sum = 0;
    for (int i = l; i <= r; i++) {
      if ((r - i + 1) >= m) sum += num[i];
    }
    printf("%d\n", sum);
  }
  return 0;
}
