#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long MAXN = 1e3 + 10;
long long n, m, q;
string a, b;
long long pref[MAXN];
inline void precalc() {
  for (long long i = 0; i < n - m + 1; ++i) {
    bool flag = true;
    for (long long j = i; j < i + m; ++j) {
      if (a[j] != b[j - i]) {
        flag = false;
        break;
      }
    }
    if (i == 0) {
      pref[i] = flag;
      continue;
    }
    pref[i] = pref[i - 1] + flag;
  }
}
inline long long get(long long i) {
  if (i < 0) return 0;
  return pref[i];
}
inline long long get_ans(long long L, long long R) {
  if (R - m + 1 < 0 || L + m - 1 > R) return 0;
  return pref[R - m + 1] - get(L - 1);
}
signed main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> q;
  cin >> a >> b;
  precalc();
  for (long long i = 0; i < q; ++i) {
    long long L, R;
    cin >> L >> R;
    --L, --R;
    cout << get_ans(L, R) << "\n";
  }
}
