#include <bits/stdc++.h>
using namespace std;
long long int countSetBits(long long int n) {
  long long int count = 0;
  while (n) {
    n &= (n - 1);
    count++;
  }
  return count;
}
long long int power(long long int x, long long int y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
long long int gcd(long long int a, long long int b) {
  long long int r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
bool pr[1000007];
void sieve() {
  pr[0] = 1;
  pr[1] = 1;
  for (int i = 2; i < sqrt(1000007); i++) {
    for (int j = 2 * i; j <= 1000007; j += i) {
      pr[j] = 1;
    }
  }
}
const int MOD = 1e9 + 7;
const int SIZE = 4e6 + 10;
const int MAX = 1e9 + 1;
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  string s, t;
  cin >> s >> t;
  int a[n + 1];
  memset((a), 0, sizeof((a)));
  for (int i = (0); i < (n - m + 1); ++i) {
    if (s.substr(i, m) == t) a[i] = 1;
  }
  while (q--) {
    int cnt = 0;
    int l, r;
    scanf("%d%d", &l, &r);
    for (int i = (l - 1); i < (r - m + 1); ++i) {
      if (a[i]) {
        cnt++;
      }
    }
    cout << cnt;
    cout << endl;
  }
  return 0;
}
