#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, q;
  cin >> n >> m >> q;
  string s1, s2;
  cin >> s1 >> s2;
  int occ[n];
  int sta[n];
  int sum[n];
  for (int o = 0; o < n; o++) {
    occ[o] = 0;
    sum[o] = 0;
    sta[o] = 0;
  }
  int v = 0;
  for (int e = 0; e < n - m + 1; e++) {
    int fl = 1;
    for (int l = 0; l < m; l++) {
      if (s1[e + l] != s2[l]) {
        fl = 0;
        break;
      }
    }
    if (fl == 1) occ[e + m - 1] = 1;
  }
  for (int g = 0; g < n; g++) {
    v = v + occ[g];
    sum[g] = v;
  }
  for (int a = 1; a <= q; a++) {
    int p, q;
    cin >> p >> q;
    if (q - p < m - 1)
      cout << "0" << endl;
    else if (p != 1)
      cout << sum[q - 1] - sum[p - 2 + m - 1] << endl;
    else
      cout << sum[q - 1] << endl;
  }
}
