#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int match[1000 + 1];
int psum[1000 + 1];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, q;
  cin >> n >> m >> q;
  string s, t;
  cin >> s >> t;
  memset(match, false, sizeof match);
  for (int i = 0; i + m - 1 < n; i++) {
    match[i + 1] = true;
    for (int j = 0; j < m; j++) {
      match[i + 1] &= s[i + j] == t[j];
    }
  }
  partial_sum(match, match + n + 1, psum);
  while (q--) {
    int L, R;
    cin >> L >> R;
    R -= m - 1;
    cout << (R >= L ? psum[R] - psum[L - 1] : 0) << '\n';
  }
  return 0;
}
