#include <bits/stdc++.h>
int pi[1002];
void pi_function(char temp[], int len) {
  int k = 0;
  for (int q = 2; q < len + 1; q++) {
    while (k > 0 && temp[k] != temp[q - 1]) k = pi[k];
    if (temp[k] == temp[q - 1]) k++;
    pi[q] = k;
  }
  return;
}
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  char s[n + 2];
  scanf("%s", s);
  char t[m + 2];
  scanf("%s", t);
  pi_function(t, m);
  for (int i = 0; i < q; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    int k = 0, ans = 0;
    for (int j = l - 1; j < r; j++) {
      if (s[j] != t[k]) {
        if (k != 0) j--;
        k = pi[k];
      } else
        k++;
      if (k == m) ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
