#include <bits/stdc++.h>
const int inf = 1000000005;
const long long INF = 3e18;
const double pi = 2 * acos(0.0);
using namespace std;
int gcd(int a, int b) {
  a = abs(a);
  b = abs(b);
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
int modInverse(int a, int m) {
  int m0 = m;
  int y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    int q = a / m;
    int t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
int lcm(int a, int b) {
  int temp = gcd(a, b);
  return temp ? (a / temp * b) : 0;
}
const int maxn = 1e3 + 10;
int n, m, q;
int tree[4 * maxn], arr[maxn];
void build(int node, int b, int e) {
  if (b == e) {
    tree[node] = arr[b];
    return;
  }
  int mid = (b + e) / 2;
  build(2 * node, b, mid);
  build((2 * node) + 1, mid + 1, e);
  tree[node] = tree[2 * node] + tree[(2 * node) + 1];
}
int query(int node, int b, int e, int i, int j) {
  if (i > e or j < b) return 0;
  if (b >= i and j >= e) return tree[node] / m;
  int mid = (b + e) / 2;
  int p1 = query(2 * node, b, mid, i, j);
  int p2 = query((2 * node) + 1, mid + 1, e, i, j);
  return p1 + p2;
}
int main() {
  cin >> n >> m >> q;
  string s, t;
  cin >> s >> t;
  vector<int> pos;
  for (int i = 0; i < s.size(); i++) {
    bool check = true;
    for (int j = 0; j < t.size(); j++) {
      if (s[i + j] != t[j]) {
        check = false;
        break;
      }
    }
    if (check == true) {
      pos.push_back(i + 1);
    }
  }
  build(1, 1, n);
  while (q--) {
    int x, y;
    cin >> x >> y;
    int ans = 0;
    for (int i = 0; i < pos.size(); i++) {
      if (pos[i] >= x and pos[i] + m - 1 <= y) {
        ans++;
      }
    }
    cout << ans << endl;
  }
}
