#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e9 + 7;
const int64_t N = 2e6;
bool isQuery = false;
int64_t power(int64_t x, int64_t n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return power(x, n / 2) * power(x, n / 2);
  else
    return x * power(x, n / 2) * power(x, n / 2);
}
int64_t powerMod(int64_t x, int64_t n, int64_t mod) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return (powerMod(x, n / 2, mod) * powerMod(x, n / 2, mod)) % mod;
  else
    return (x * powerMod(x, n / 2, mod) * powerMod(x, n / 2, mod)) % mod;
}
void solve() {
  int64_t n, m, q;
  cin >> n >> m >> q;
  string s, t;
  cin >> s >> t;
  vector<int64_t> dp(n, 0), pref(n, -1), suff(n, -1), id;
  int64_t ans = 0, p = -1;
  for (int64_t i = 0, j; i < n; i++) {
    for (j = 0; j < m && i + j < n; j++) {
      if (s[i + j] != t[j]) break;
    }
    if (j == m)
      pref[i + m - 1] = i + m - 1, id.push_back(i + m - 1), dp[i + m - 1] = 1;
  }
  for (int64_t i = 1; i < n; i++)
    if (pref[i] == -1) pref[i] = pref[i - 1];
  for (int64_t i = n - 1, j; i >= 0; i--) {
    for (j = m - 1; j >= 0 && i - j >= 0; j--) {
      if (s[i - (m - 1 - j)] != t[j]) break;
    }
    if (j == -1) suff[i - m + 1] = i;
  }
  for (int64_t i = n - 2; i >= 0; i--)
    if (suff[i] == -1) suff[i] = suff[i + 1];
  for (int64_t i = 1; i < n; i++) dp[i] += dp[i - 1];
  while (q--) {
    int64_t l, r;
    cin >> l >> r;
    l--, r--;
    if (pref[r] == -1 || suff[l] == -1 | pref[r] < suff[l])
      cout << 0;
    else if (suff[l] > 0)
      cout << dp[pref[r]] - dp[suff[l] - 1];
    else
      cout << dp[pref[r]];
    cout << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int64_t t = 1;
  if (isQuery) cin >> t;
  while (t--) {
    solve();
    cout << endl;
  }
}
