#include <bits/stdc++.h>
using namespace std;
int arr[1001] = {0};
int u[200001] = {0};
int main() {
  ios::sync_with_stdio(false);
  int n, m, q, i, l, r;
  cin >> n >> m >> q;
  string s, t, ch;
  cin >> s >> t;
  int pos = -1, x = 0;
  while (pos + 1 < s.size() && s.find(t, pos + 1) != string::npos) {
    pos = s.find(t, pos + 1);
    arr[pos + t.size() - 1]++;
  }
  for (i = 1; i < n; i++) {
    arr[i] += arr[i - 1];
  }
  for (i = 1; i <= q; i++) {
    cin >> l >> r;
    if (r - l + 1 < t.size())
      cout << "0";
    else if (l > 1) {
      cout << arr[r - 1] - arr[l - 1 + t.size() - 2];
    } else if (l == 1) {
      cout << arr[r - 1];
    }
    if (i != q) cout << endl;
  }
  return 0;
}
