#include <bits/stdc++.h>
const double EPS = 0.00000001;
const long long mod = 1000000000 + 7;
using namespace std;
string s, t;
int a[2000], sum[2000];
int main() {
  cout.sync_with_stdio(0);
  int n, m, q;
  cin >> n >> m >> q >> s >> t;
  for (int i = 0; i < n; i++) {
    int is = 1;
    for (int j = 0; j < m; j++) {
      if (i + j == n || s[i + j] != t[j]) {
        is = 0;
        break;
      }
    }
    if (is) a[i] = 1;
  }
  sum[0] = a[0];
  for (int i = 1; i < n; i++) sum[i] = a[i] + sum[i - 1];
  while (q--) {
    int i, j;
    cin >> i >> j;
    if (j - i + 1 < m) {
      cout << 0 << endl;
      continue;
    }
    i--, j--;
    cout << max(sum[j - m + 1] - sum[i] + a[i], 0) << endl;
  }
  return 0;
}
