#include <bits/stdc++.h>
using namespace std;
const int N = 1111;
string s, t;
int sum[N];
int n, m, q;
signed main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> q >> s >> t;
  for (int i = (1); i <= (n); i++) {
    bool found = true;
    for (int j = (0); j <= (m - 1); j++) {
      int ii = i - 1 + j;
      if (ii < n && s[ii] != t[j]) {
        found = false;
        break;
      }
    }
    sum[i] = sum[i - 1] + found;
  }
  while (q--) {
    int l, r;
    cin >> l >> r;
    int ans = 0;
    if (r - m + 1 >= 1) {
      ans = max(0, sum[r - m + 1] - sum[l - 1]);
    }
    cout << ans << "\n";
  }
  return 0;
}
