#include <bits/stdc++.h>
using namespace std;
string s, t;
int n, m, q;
int v[100000] = {};
void match() {
  for (int i = 0; i <= n - m; i++) {
    v[i + 1] = v[i] + (s.substr(i, m) == t);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m >> q;
  cin >> s;
  cin >> t;
  match();
  for (int i = 0; i < q; i++) {
    int a, b;
    cin >> a >> b;
    if ((b - a + 1) < m)
      cout << "0\n";
    else {
      cout << v[b - m + 1] - v[a - 1] << endl;
    }
  }
  return 0;
}
