Grand Opening
시간 제한1초메모리 제한2048 MB
n개의 격자 모양 자물쇠와 열쇠 하나가 주어질 때, 모든 칸이 어긋나지 않고 맞는 자물쇠의 개수를 센다.
문제
Working at a lock recycling company can be a pain, especially when the locks need to be unlocked and reusable and people forgot to turn in their keys. A friend that works at such a company has found a solution to this problem: a bump key. Your friend has a list of specifications for the tumblers in each lock, and needs your help. You are tasked with finding out which locks he should attempt to open using a bump key, and which locks are for the furnace.
The key and locks are made of the character "#", and the rest is indicated by a dot. In the example below, you can see that the key on the left doesn't fit the lock on the right. The parts where the key doesn't fit are marked with a "■".

입력
- A line with three space-separated integers and , indicating the number of locks, and the width and height of the key and locks.
- locks, where each lock consists of lines of characters "#" or ".".
- lines of character "#" or ".", representing the key.
출력
A single integer, the number of locks the given key fits in.