#include <bits/stdc++.h>
using namespace std;
const long long mod[] = {(long long)1e9 + 7, (long long)1e9 + 9,
                         (long long)1e9 + 21, (long long)1e9 + 33};
const int maxn = 2e3 + 5;
const int Nmod = 3;
string a, b;
int i, j, n, m, q;
long long Pow[Nmod][maxn];
static long long Hash[Nmod][maxn], Hash1[Nmod][maxn], Key[Nmod];
static int dp[maxn][maxn];
long long gethash(int i, int j, int type) {
  return (Hash[type][j] - Hash[type][i - 1] * Pow[type][j - i + 1] +
          (long long)mod[type] * (long long)mod[type]) %
         mod[type];
}
void init() {
  cin >> n >> m >> q;
  cin >> a;
  a = " " + a;
  for (int i = 0; i < Nmod; ++i) {
    Pow[i][0] = 1;
    for (int j = 1; j <= n; ++j) Pow[i][j] = (Pow[i][j - 1] * 31) % mod[i];
  }
  for (int i = 0; i < Nmod; ++i) {
    Hash[i][0] = 0;
    for (int j = 1; j <= n; ++j)
      Hash[i][j] = (Hash[i][j - 1] * 31 + a[j] - 'a') % mod[i];
  }
  cin >> b;
  b = " " + b;
  for (int i = 0; i < Nmod; ++i) {
    for (int j = 1; j <= m; ++j) {
      Key[i] = (Key[i] * 31 + b[j] - 'a') % mod[i];
    }
  }
  for (int t = (1); t <= (n); ++t) {
    for (int i = t; i <= n - m + 1; ++i) {
      int ok = 1;
      for (int j = 0; j < Nmod; ++j) {
        ok = min(ok, (int)(gethash(i, i + m - 1, j) == Key[j]));
      }
      dp[t][i + m - 1] = dp[t][i + m - 2] + ok;
    }
  }
  for (int i = (1); i <= (q); ++i) {
    int x, y;
    cin >> x >> y;
    cout << dp[x][y] << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  init();
  return 0;
}
