#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 1010;
char a[maxn], b[maxn];
int n, m, q;
vector<int> pos;
void solve() {
  while (q--) {
    int l, r, tr;
    scanf("%d%d", &l, &r);
    tr = r - m + 1;
    if (l > tr)
      puts("0");
    else {
      printf("%d\n",
             upper_bound(pos.begin(), pos.end(), tr) - pos.begin() -
                 (lower_bound(pos.begin(), pos.end(), l) - pos.begin()));
    }
  }
}
int main() {
  cin >> n >> m >> q;
  cin >> a + 1;
  cin >> b + 1;
  for (int i = 1; i <= n; ++i) {
    bool ok = true;
    for (int j = 0; j < m; ++j) {
      if (i + j > n || (a[i + j] != b[j + 1])) {
        ok = false;
        break;
      }
    }
    if (ok) pos.push_back(i);
  }
  solve();
  return 0;
}
