#!/usr/bin/perl $n = ; chomp $n; $height_temp = ; @height = split / /,$height_temp; chomp @height; my $max = 0; my $maxLen = 0; for(my $i=0; $i<@height; $i++) { if($height[$i] > $max) { $max = $height[$i]; } } foreach my $i(@height){ if($i == $max) {$maxLen++; } } print $maxLen;