#include <bits/stdc++.h>
using namespace std;
string st, subSt;
int lenSt, lenSubSt, queries;
vector<int> positions;
int main() {
  ios::sync_with_stdio(0);
  cin >> lenSt >> lenSubSt >> queries;
  cin >> st;
  cin >> subSt;
  bool found;
  for (int i = 0; i < lenSt - (lenSubSt - 1); i++) {
    found = true;
    for (int j = 0; j < lenSubSt; j++) {
      if (st[i + j] != subSt[j]) {
        found = false;
        break;
      }
    }
    if (found) {
      positions.push_back(i);
    }
  }
  int l, k;
  for (int i = 0; i < queries; i++) {
    cin >> l >> k;
    auto firstIndex = lower_bound(positions.begin(), positions.end(), l - 1);
    auto secondIndex =
        upper_bound(positions.begin(), positions.end(), k - lenSubSt);
    if (secondIndex - firstIndex < 0) {
      cout << 0 << endl;
    } else {
      cout << secondIndex - firstIndex << endl;
    }
  }
  return 0;
}
