#include <bits/stdc++.h>
int occ[10000];
using namespace std;
int main() {
  int n, m, q;
  int sol;
  cin >> n >> m >> q;
  string s1, s2;
  cin >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    bool test = true;
    for (int j = 0; j < m; j++) {
      if (s1[i + j] != s2[j]) {
        test = false;
        break;
      }
    }
    occ[i] = test;
  }
  while (q--) {
    int sol = 0;
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    for (int i = a; i <= b; i++) {
      sol += occ[i] && (b - i + 1) >= s2.length();
    }
    cout << sol << endl;
  }
}
