#include <bits/stdc++.h>
using namespace std;
int n, m, q, arr[1001], l, r;
string s, t;
int main() {
  cin >> n >> m >> q;
  cin >> s >> t;
  for (int i = 0; i <= n - m; i++) {
    arr[i + 1] = arr[i];
    if (s.substr(i, m) == t) {
      arr[i + 1]++;
    }
  }
  for (int j = 1; j <= q; j++) {
    cin >> l >> r;
    if (r - l + 1 < m)
      cout << 0 << endl;
    else {
      cout << arr[r - m + 1] - arr[l - 1] << endl;
    }
  }
}
