#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize(4)
using namespace std;
const int N = 1e3 + 5;
int sum[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m, q, l, r;
  string s, t;
  cin >> n >> m >> q;
  cin >> s >> t;
  for (int i = 0; i + m - 1 < n; i++) {
    bool f = true;
    for (int j = 0; j < m; j++) {
      if (s[i + j] != t[j]) {
        f = false;
        break;
      }
    }
    if (f) sum[i + 1]++;
  }
  for (int i = 1; i <= n; i++) sum[i] += sum[i - 1];
  while (q--) {
    cin >> l >> r;
    r = r - m + 1;
    if (r >= l)
      cout << sum[r] - sum[l - 1] << endl;
    else
      cout << 0 << endl;
  }
  return 0;
}
