#include <bits/stdc++.h>
using namespace std;
int n, m, q, a[2010], sum[2010];
string s, t;
vector<pair<int, int> > v;
int main() {
  cin >> n >> m >> q;
  cin >> s;
  cin >> t;
  for (int i = 0; i < n && i + m - 1 < n; i++) {
    bool found = true;
    for (int j = 0; j < m && j + i < n; j++) {
      if (s[i + j] != t[j]) {
        found = false;
        break;
      }
    }
    if (found) {
      v.push_back({i + 1, i + m});
    }
  }
  for (int i = 1; i <= q; i++) {
    int l, r;
    cin >> l >> r;
    int ans = 0;
    for (auto interval : v) {
      if (interval.first >= l && interval.second <= r) ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
