#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, q, t = 0;
  string a, b, s = "";
  cin >> n >> m >> q >> a >> b;
  vector<pair<int, int> > v;
  while (t + b.size() - 1 < a.size()) {
    if (a.substr(t, b.size()) == b) {
      v.push_back({t + 1, t + b.size()});
    }
    t++;
  }
  while (q--) {
    int l, r;
    cin >> l >> r;
    int c = 0;
    for (int i = 0; i < v.size(); i++) {
      if (l <= v[i].first && r >= v[i].second) c++;
    }
    cout << c << '\n';
  }
}
