#CCBCHBAHAI0000151. Nến sinh nhật (Birthday Cake Candles)

Nến sinh nhật (Birthday Cake Candles)

Birthday Cake Candles

Source: HackerRank

Version: Phuoc Hung OJ Extended

Problem Statement

There are nn candles and candle ii has height hih_i. Only candles whose height equals the maximum height are counted.

Let

H=max⁡0≤i<nhi.H=\max_{0\le i<n} h_i.

Count the indices ii such that hi=Hh_i=H.

Input

  • The first line contains an integer nn.
  • The second line contains nn integers h0,h1,…,hn−1h_0,h_1,\ldots,h_{n-1}.

Output

Print one integer: the number of tallest candles.

Subtasks

Subtask 1 (100 points): 1≤n≤1051\le n\le10^5; 1≤hi≤1071\le h_i\le10^7.

Examples

Input

4
3 2 1 3

Output

2

Explanation

The maximum height is H=3H=3. Height 33 occurs at indices 00 and 33, so there are exactly 22 tallest candles.