6
12 8 12 17 20 5
17 4 8 8 8 4
 6
4 1 12 9 3 11
12 20 19 12 19 11
 1
1
1
 2
1 2
1 1
 1
7
5
 6
16 20 18 7 14 2
17 12 4 10 7 4

705
 917
 1
 9
 5
 741

import java.io.*;
import java.util.*;
import java.lang.*;
import java.awt.*;
import java.awt.geom.*;
import java.math.*;
import java.text.*;
public class   cf912
{
  BufferedReader in;
  StringTokenizer as;
  int nums[],nums2[];
  public static void main (String[] args)
  {
    new cf912  ();
  }
  
  public cf912  ()
  {
    try
    {
      in = new BufferedReader (new InputStreamReader (System.in));
      int a = nextInt();
      int b = nextInt();
      int q = nextInt();
      nums = new int [a];
      int z = 0;
      String c = nextLine();
      String d = nextLine();
      for(;;)
      {
        int temp = c.indexOf(d,z);
        if(temp == -1)
          break;
        nums[temp]++;
        z = temp +1;
      }
      for(int x1 = 0;x1<q;x1++)
      {
        int aa = nextInt();
        int bb = nextInt();
        aa--;
        bb--;
        int temp1 = 0;
        for(int x = aa;x<bb-b+2;x++)
          temp1 += nums[x];
        System.out.println(temp1);
      }
     
      
    }
    
    
    catch(Exception e)
    {
      
    }
  }
  
  
  
  
  
  
  
  String next () throws IOException
  {
    while (as == null || !as.hasMoreTokens ())
    {
      as = new StringTokenizer (in.readLine ().trim ());
    }
    
    
    return as.nextToken ();
  }
  
  
  
  long nextLong () throws IOException
  {
    return Long.parseLong (next ());
  }
  
  
  int nextInt () throws IOException
  {
    return Integer.parseInt (next ());
  }
  
  
  double nextDouble () throws IOException
  {
    return Double.parseDouble (next ());
  }
  
  
  String nextLine () throws IOException
  {
    return in.readLine ().trim ();
  }
}