#!/usr/bin/perl $n = ; chomp $n; $height_temp = ; @height = split / /,$height_temp; chomp @height; $max_height = 0; $num_max = 0; while ($x = pop @height) { if ($x > $max_height) { $max_height = $x; $num_max = 1; } elsif ($x == $max_height) { $num_max++; } } print $num_max;