#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, q;
  string s, t;
  cin >> n >> m >> q;
  cin >> s >> t;
  vector<int> v;
  v.clear();
  if (n < m) {
    for (int i = 0; i < q; i++) {
      int a, b;
      cin >> a >> b;
      cout << "0" << endl;
    }
    return 0;
  }
  for (int i = 0; i <= s.size() - t.size(); i++) {
    int j;
    int val = i;
    for (j = 0; j < t.size(); j++) {
      if (t[j] == s[val++])
        continue;
      else
        break;
    }
    if (j == t.size()) v.push_back(i);
  }
  if (v.size() == 0) {
    for (int i = 0; i < q; i++) {
      int a, b;
      cin >> a >> b;
      cout << "0" << endl;
    }
    return 0;
  }
  for (int i = 0; i < q; i++) {
    int a, b;
    cin >> a >> b;
    a = a - 1;
    b = b - 1;
    int count = 0;
    for (int p = 0; p < v.size(); p++) {
      if (v[p] >= a && v[p] + m - 1 <= b) count++;
    }
    cout << count << endl;
  }
  return 0;
}
