#include <bits/stdc++.h>
using namespace std;
int n, m, q;
int nxt[100001];
char s[100001], t[100001];
int temp[100001];
int l, r;
bool check(int u) {
  for (int i = 0; i < m; ++i) {
    if (s[u + i] != t[i]) return 0;
  }
  return 1;
}
void pre_do() {
  for (int i = 1; i <= n - m + 1; i++) {
    temp[i] += check(i);
  }
}
void putin() {
  cin >> n >> m >> q;
  scanf("%s%s", s + 1, t);
}
int main() {
  putin();
  pre_do();
  for (int i = 1; i <= n; i++) {
    temp[i] += temp[i - 1];
  }
  for (int i = 1; i <= q; i++) {
    cin >> l >> r;
    if (r - l + 1 < m)
      cout << 0 << endl;
    else
      cout << temp[r - m + 1] - temp[l - 1] << endl;
  }
}
