#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T> >;
const int maxn = (int)1e5 + 5;
const int inf = (int)1e9 + 7;
const ll linf = (ll)1e18 + 7;
const ld pi = acosl(-1.0);
const ld eps = 1e-9;
void S() {
  int n, m, q;
  cin >> n >> m >> q;
  string s, t;
  cin >> s >> t;
  set<int> p;
  for (int i = 0; i < n; i++)
    if (s.substr(i, m) == t) p.insert(i);
  while (q--) {
    int l, r;
    cin >> l >> r;
    int an = 0;
    for_each((p).begin(), (p).end(),
             [&](int cur) { an += cur >= (l - 1) && cur + m <= r; });
    cout << an << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  S();
  return 0;
}
