#include <bits/stdc++.h>
using namespace std;
vector<int> l, r;
int main() {
  string s, t;
  int n, m, q, x, y;
  cin >> n >> m >> q >> s >> t;
  for (int i = 0; i < n; i++) {
    int flag = 1;
    if (s[i] == t[0]) {
      for (int j = i, k = 0; j < n && k < m; j++, k++)
        if (s[j] != t[k]) {
          flag = 0;
          break;
        }
      if (flag) {
        l.push_back(i + 1);
        r.push_back(i + m);
      }
    }
  }
  while (q--) {
    cin >> x >> y;
    int a, cnt = 0;
    a = lower_bound(l.begin(), l.end(), x) - l.begin();
    for (int i = a; i < l.size(); i++) {
      if (l[i] >= x && r[i] <= y) cnt++;
      if (r[i] > y) break;
    }
    cout << cnt << endl;
  }
  return 0;
}
