Problem

4 /11


Matrix search

Problem

Write a program that determines how many times an element equal to K  occurs in a matrix.

Input
The first line contains the dimensions of the matrix separated by a space: the number of rows N and the number of columns M  (\(1 <= N , M <= 100\)). The following N lines contain matrix rows, each – by M natural numbers separated by spaces. The last line contains an integer K.

Imprint
The program should output the number of matrix elements equal to K.
 

Example
# Input Output
1 4 5
1 2 3 4 5
6 12 8 9 10
11 12 12 14 15
16 17 18 12 20
12
4