C - Number of Apperance Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 8

問題文

長さ N の整数列 A = (A_1,A_2,\ldots ,A_N) が与えられます。この整数列の中に整数 X は何回現れますか?

制約

  • 1 \leq N \leq 10^5
  • 1 \leq X \leq 10^9
  • 1 \leq A_i \leq 10^9
  • 入力は全て整数である。

入力

入力は以下の形式で標準入力から与えられる。

N X
A_1 A_2 \ldots A_N

出力

整数列 A の中に整数 X が現れる回数、すなわち A_i=X をみたす i の個数を出力せよ。


入力例 1

3 3
2 3 3

出力例 1

2

整数列 A の中に 3 という整数は 2 回現れます。


入力例 2

3 1
2 3 3

出力例 2

0

入力例 3

5 2
2 3 4 2 2

出力例 3

3

Score : 8 points

Warning

Do not make any mention of this problem until October 2, 2021, 6:00 p.m. JST. In case of violation, compensation may be demanded. After the examination, you can reveal your total score and grade to others, but nothing more (for example, which problems you solved).

Problem Statement

You are given a sequence of N integers: A = (A_1,A_2,\ldots ,A_N). How many times does the integer X occur in this sequence?

Constraints

  • 1 \leq N \leq 10^5
  • 1 \leq X \leq 10^9
  • 1 \leq A_i \leq 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

N X
A_1 A_2 \ldots A_N

Output

Print the number of times the integer X occurs in the sequence A, that is, the number of indices i such that A_i=X.


Sample Input 1

3 3
2 3 3

Sample Output 1

2

In the sequence A, the integer 3 occurs twice.


Sample Input 2

3 1
2 3 3

Sample Output 2

0

Sample Input 3

5 2
2 3 4 2 2

Sample Output 3

3