import Data.List

main = do
  str <- getLine
  let n = read str ::Int
  str <- getLine
  let p = take n $ map read (words str) ::[Int]
  let list = tails $ reverse p
  let list' = (reverse . (drop 1) . reverse) list
  print $ length $ filter (\all@(x:xs) -> x == minimum all) list' 