#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  int n, m, q;
  scanf("%d %d %d", &n, &m, &q);
  string a, b;
  cin >> a >> b;
  int ps[1007] = {0};
  for (int i = 1; i <= n; i++) {
    if (i < m) continue;
    bool flag = false;
    for (int j = i - m; j < i; j++)
      if (a[j] != b[j - i + m]) flag = true;
    if (!flag)
      ps[i] = ps[i - 1] + 1;
    else
      ps[i] = ps[i - 1];
  }
  while (q--) {
    int x, y;
    scanf("%d %d", &x, &y);
    x += (m - 1);
    if (x > y)
      puts("0");
    else
      printf("%d\n", ps[y] - ps[x - 1]);
  }
  return 0;
}
