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