#include <bits/stdc++.h>
using namespace std;
void urmi() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  long long n, m, q, i, c = 0, d = 0, e, f;
  cin >> n >> m >> q;
  string s, t;
  cin >> s >> t;
  map<long long, long long> m1;
  for (i = 0; i < n; i++) {
    if (s.compare(i, t.size(), t) == 0) {
      d++;
      m1[i] = d;
    } else
      m1[i] = m1[i - 1];
  }
  while (q--) {
    long long l, r;
    cin >> l >> r;
    r -= m - 1;
    l--;
    if (r >= l) {
      cout << m1[r - 1] - m1[l - 1] << endl;
    } else
      cout << "0" << endl;
  }
}
