#include <bits/stdc++.h>
using namespace std;
char a[1000010];
char b[1000010];
int f[1000010];
int n, m, t;
int main() {
  cin >> n >> m >> t;
  cin >> a + 1 >> b;
  for (int i = 1; i <= n - m + 1; i++) {
    bool mark = 1;
    for (int j = 0; j < m; j++) {
      if (a[i + j] != b[j]) {
        mark = 0;
        break;
      }
    }
    if (mark == 0)
      f[i] = f[i - 1];
    else
      f[i] = f[i - 1] + 1;
  }
  while (t--) {
    int l, r;
    cin >> l >> r;
    if (r - l + 1 < m)
      puts("0");
    else
      cout << f[r - m + 1] - f[l - 1] << "\n";
  }
  return 0;
}
