#부호 + 테스트 케이스 번호 + " " + 검색된 문자열 개수
import java.util.Scanner;
import java.io.FileInputStream;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
/*int T;
T=sc.nextInt();*/
for(int test_case = 1; test_case <= 10; test_case++)
{
int N = sc.nextInt();
String remind = sc.next();
String total = sc.next();
String newTotal = total.replaceAll(remind, "");
int answer = (total.length()- newTotal.length())/remind.length();
System.out.println("#" + N + " " + answer);
}
}
}

import java.util.HashMap;
import java.util.Scanner;
import java.io.FileInputStream;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
int T;
T=10;
for(int test_case = 1; test_case <= T; test_case++)
{
int N = sc.nextInt();
String F = sc.next();
String Hole = sc.next();
int original = Hole.length();
Hole = Hole.replaceAll(F, "");
int answer = (original - Hole.length()) / F.length();
System.out.println("#" + test_case + " " + answer);
}
}
}