Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-x-necha-marta

How many times x occurs

Easy 1000 ms 128 MB 26%
Share

A positive integer $n$, an array of $n$ integers and an integer $x$ are given. Determine how many times the number $x$ occurs in the array.

Counting how many times the searched element occurs in the array

Input

The first line contains a positive integer $n$. The second line contains $n$ integers. The third line contains $x$.

Output

One integer — the number of occurrences of $x$ ($0$ if it does not occur).

Note

$1 \le n \le 10^{4}$
$-1000 \le a_{i}, x \le 1000$

Examples

Input #1
6
3 1 3 2 3 5
3
Output #1
3
Input #2
3
1 2 3
9
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.