#include <bits/stdc++.h>
using namespace std;
string str, sub;
vector<long long int> v;
int main() {
  long long int n, m, q, x, y;
  cin >> n >> m >> q;
  cin >> str >> sub;
  size_t pos = str.find(sub, 0);
  while (pos != string::npos) {
    v.push_back(pos);
    pos = str.find(sub, pos + 1);
  }
  while (q--) {
    cin >> x >> y;
    x--;
    y--;
    long long int ans = 0;
    std::vector<long long int>::iterator low, up;
    low = std::lower_bound(v.begin(), v.end(), x);
    long long int l = low - v.begin();
    for (long long int i = low - v.begin(); i < v.size(); i++) {
      if (v[i] > y) break;
      if (v[i] + m - 1 <= y) ans++;
    }
    cout << ans << endl;
  }
}
