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