#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> left, right;
  int n, m, s, l, r;
  string kata, q;
  cin >> n >> m >> s;
  cin >> kata >> q;
  size_t pos = kata.find(q, 0);
  while (pos != string::npos) {
    left.push_back(pos + 1);
    right.push_back(pos + m);
    pos = kata.find(q, pos + 1);
  }
  vector<int>::iterator low, up;
  for (int i = 0; i < s; i++) {
    cin >> l >> r;
    int lef = lower_bound(left.begin(), left.end(), l) - left.begin();
    int righ = lower_bound(right.begin(), right.end(), r + 1) - right.begin();
    if (righ - lef >= 0)
      cout << righ - lef << endl;
    else
      cout << 0 << endl;
  }
  return 0;
}
