#include <bits/stdc++.h>
using namespace std;
void add_self(int& a, int b) {
  a += b;
  if (a >= (int)1e9 + 7) a -= (int)1e9 + 7;
}
void solve() {
  int n, m, q;
  cin >> n >> m >> q;
  string s, t;
  cin >> s >> t;
  vector<int> a(n + 1, 0);
  int cnt = 0;
  for (int i = 0; i <= n - m; i++) {
    bool ok = true;
    int k = 0;
    for (int j = i; j < i + m; j++) {
      if (s[j] != t[k++]) {
        ok = false;
        break;
      }
    }
    if (ok) {
      cnt++;
    }
    a[i + 1] = cnt;
  }
  for (int i = n - m + 1; i <= n; i++) a[i] = cnt;
  while (q--) {
    int l, r;
    cin >> l >> r;
    int t = r - m + 1;
    cout << (a[t] - a[l - 1]) * (r - l + 1 >= m) << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  int q = 1;
  for (int i = 1; i <= q; i++) {
    solve();
  }
}
