#include <bits/stdc++.h>
using namespace std;
long long n, m, q, l, r;
long long arr[10000];
char s[10000], t[10000];
int main() {
  cin >> n >> m >> q;
  cin >> s + 1 >> t + 1;
  for (long long i = 1; i <= n - m + 1; i++) {
    int acc = 1;
    for (int j = 1; j <= m; j++)
      if (acc == 1 && s[i + j - 1] != t[j]) acc = 0;
    arr[i] = arr[i - 1] + acc;
  }
  while (q--) {
    cin >> l >> r;
    if (r >= l + m - 1)
      cout << arr[r - m + 1] - arr[l - 1] << "\n";
    else
      cout << 0 << "\n";
  }
  return 0;
}
