import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto Q = s[2];

    auto S = readln.chomp;
    auto T = readln.chomp;
    auto A = new int[](N+1);

    foreach (i; 0..N-M+1) {
        bool ok = true;
        foreach (j; i..i+M) {
            if (S[j] != T[j-i]) {
                ok = false;
                break;
            }
        }
        if (ok) A[i+1] += 1;
    }

    foreach (i; 0..N) A[i+1] += A[i];

    while (Q--) {
        s = readln.split.map!(to!int);
        int l = s[0] - 1;
        int r = s[1] - M;
        if (l > r)
            writeln(0);
        else
            writeln(A[r+1] - A[l]);
    }

}
