text: #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  """
  @created: 09.05.20
  @author: felix
  """
  import math
  import os
  import random
  import re
  import sys
  
  # Complete the birthdayCakeCandles function below.
  def birthdayCakeCandles(ar):
      max_ar = max(ar)
      return sum([1 for i in ar if i == max_ar])
  
  
  if __name__ == '__main__':
      ar_count = int(input())
  
      ar = list(map(int, input().rstrip().split()))
  
      result = birthdayCakeCandles(ar)
      print(result)
  