#include <bits/stdc++.h>
using namespace std;
int st[1001];
int main() {
  int n, m, q;
  cin >> n >> m >> q;
  string s;
  cin >> s;
  string t;
  cin >> t;
  st[0] = 0;
  for (int i = 1; i <= n - m + 1; i++) {
    bool b = true;
    for (int j = i; j < i + m; j++) {
      if (s.at(j - 1) != t.at(j - i)) {
        b = false;
        break;
      }
    }
    if (b) {
      st[i] = st[i - 1] + 1;
    } else {
      st[i] = st[i - 1];
    }
  }
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    if (r - l < m - 1) {
      cout << 0 << endl;
    } else {
      cout << st[r - m + 1] - st[l - 1] << endl;
    }
  }
  return 0;
}
