#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, q;
  cin >> n >> m >> q;
  string s;
  cin >> s;
  string t;
  cin >> t;
  string str1 = s;
  size_t pos1;
  vector<long long> arr;
  pos1 = str1.find(t);
  while (pos1 != string::npos) {
    arr.push_back(pos1);
    pos1 = str1.find(t, pos1 + 1);
  }
  while (q--) {
    long long l, r;
    cin >> l >> r;
    long long count = 0;
    for (long long i = 0; i < arr.size(); i++) {
      if (arr[i] >= (l - 1) && (r - 1) >= (arr[i] + m - 1)) {
        count++;
      }
    }
    cout << count << endl;
  }
  return 0;
}
