
import java.util.Scanner;
class Solution {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        for (int testCase = 1; testCase <= 10; testCase++) {
            int tc = sc.nextInt();
            String find = sc.next();
            String check = sc.next();
            int result = 0;
            for (int i = 0; i <= check.length() - find.length(); i++) {
                if (check.substring(i, i + find.length()).compareTo(find) == 0) {
                    result++;
                }
            }
            System.out.printf("#%d %d\n", testCase, result);
        }
    }
}
find는 찾아야할 문자, check는 입력받은 문장
for문을 돌면서 check에서 find크기만큼의 substring과 find를 비교후 같으면 result를 더해주는 방식