#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int64_t n, m, q;
  string s, t;
  cin >> n >> m >> q >> s >> t;
  vector<pair<int, int>> ins;
  for (int i = 0; i < s.size(); ++i) {
    if (i + t.size() - 1 < s.size() && s.substr(i, t.size()) == t) {
      ins.push_back(make_pair(i, i + t.size() - 1));
    }
  }
  for (int i = 0; i < q; ++i) {
    int64_t l, r, cnt = 0;
    cin >> l >> r;
    --l;
    --r;
    for (auto now : ins) {
      if (now.first >= l && now.second <= r) {
        ++cnt;
      }
    }
    cout << cnt << '\n';
  }
  return 0;
}
