#include <bits/stdc++.h>
using namespace std;
inline int two(int n) { return 1 << n; }
inline void set_bit(int& n, int b) { n |= two(b); }
inline void unset_bit(int& n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
const int maxx = 1e4;
int arr[maxx] = {0};
string s, t;
int n, m, q;
bool ok = true;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  cin >> s >> t;
  for (int i = 0; i < n - m + 1; ++i) {
    if (s[i] == t[0]) {
      ok = true;
      for (int j = 0; j < m; ++j) {
        if (j + i > n - 1) break;
        if (s[j + i] != t[j]) {
          ok = false;
          break;
        }
      }
      if (ok) arr[i] = 1;
    }
    if (i > 0) arr[i] += arr[i - 1];
  }
  while (q--) {
    int start, end;
    cin >> start >> end;
    start--, end--;
    if (end - start + 1 < m)
      cout << 0 << '\n';
    else
      cout << arr[end - m + 1] - (start ? arr[start - 1] : 0) << '\n';
  }
}
