题目描述

RSYJ is a computer scientist. He has developed many useful image search tools. But now he has encountered some problems.

We use a matrix**H × H** of to represent a bitmap with **H × H **size, and each pixel of the **8**‑bit bitmap is represented by the integer between* [0, 255]*.

Now, RSYJ have a** 8**‑bit bitmap **A** with **m × m** size, and a **8**‑bit bitmap **B** with **m × m** size.RSYJ uses an image processing software to copy bitmap **B** to some positions in bitmap **A**. Due to RSYJ’s computer’s error, the value of each pixel in the bitmap **B** is added with an offset** k**, which is an integer, but RSYJ doesn’t know what * k* is.

Now your task is writing a program to help RSYJ find all positions of bitmap*B* in the bitmap **A**. To simplify the problem, you only need output how many positions of bitmap **B** in bitmap** A**.

For example, here are two bitmaps*A* and **B **:

A:

10 9 3

11 6 5

15 7 2

B:

4 3

5 0

Bitmap*B* was added with an offset **6**. It becomes:

10 9

11 6

Bitmap*B* was added with an offset** 2**. It becomes:

6 5

7 2

So there are two positions of bitmap*B* in bitmap **A**.

We use a matrix

Now, RSYJ have a

Now your task is writing a program to help RSYJ find all positions of bitmap

For example, here are two bitmaps

A:

10 9 3

11 6 5

15 7 2

B:

4 3

5 0

Bitmap

10 9

11 6

Bitmap

6 5

7 2

So there are two positions of bitmap

输入

The first line of the input gives two positive integers

The next

The next m lines give the bitmap

输出

Please output an integer, representing the number of positions of bitmap *B* in bitmap **A**.

样例输入
Copy

```
3 2
1 2 9
3 4 7
5 6 0
3 4
5 6
```

样例输出 Copy

`2`

来源/分类