#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100005;
int BIT[MaxN];
void update(int pos) {
  int i, j, p, q;
  for (i = pos; i < MaxN; i += i & (-i)) {
    BIT[i] += 1;
  }
}
int query(int pos) {
  int i, j, p = 0, q;
  for (i = pos; i > 0; i -= i & (-i)) {
    p += BIT[i];
  }
  return p;
}
int main() {
  cin.tie(0), ios_base::sync_with_stdio(0);
  int N, M, K, i, j, p, q;
  bool proof;
  cin >> N >> M >> K;
  string a, b;
  cin >> a >> b;
  for (i = 0; i <= N - M; i++) {
    proof = 1;
    for (j = i; j < i + M; j++) {
      if (a[j] != b[j - i]) {
        proof = 0;
        continue;
      }
    }
    if (proof) {
      update(i + 1);
    }
  }
  for (i = 0; i < K; i++) {
    cin >> p >> q;
    if (q - M - p + 1 < 0)
      cout << "0\n";
    else
      cout << query(q - M + 1) - query(p - 1) << "\n";
  }
}
