#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, q, l, r;
  cin >> n >> m >> q;
  string a, b;
  cin >> a >> b;
  bool p[n + 1];
  for (int i = 0; i < n + 1; i++) {
    bool f = true;
    for (int j = 0; j < m; j++)
      if (a[i + j] != b[j]) {
        f = false;
        break;
      }
    p[i + 1] = f;
  }
  while (q--) {
    cin >> l >> r;
    int c = 0;
    for (int i = l; i + m - 1 <= r; i++)
      if (p[i] && i + m - 1 <= r) c++;
    cout << c << endl;
  }
}
