#include <bits/stdc++.h>
using namespace std;
int n, m, q;
string s, t;
int a[1024];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m >> q;
  cin >> s >> t;
  for (int i = 0; i <= n - m; i++) {
    a[i] = 1;
    for (int j = 0; j < m; j++) {
      if (s[i + j] != t[j]) {
        a[i] = 0;
        break;
      }
    }
  }
  for (int i = 1; i < n; i++) a[i] += a[i - 1];
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    if (r - l + 1 < m) {
      cout << "0\n";
      continue;
    }
    if (l == 1)
      cout << a[r - m] << '\n';
    else
      cout << a[r - m] - a[l - 2] << '\n';
  }
  return 0;
}
