import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int height[] = new int[n]; for(int height_i=0; height_i < n; height_i++){ height[height_i] = in.nextInt(); } int result=0; if(height[0]>=height[1] && height[0]>=height[2] && height[0]>=height[3]){result++;} if(height[1]>=height[0] && height[1]>=height[2] && height[1]>=height[3]){result++;} if(height[2]>=height[0] && height[2]>=height[1] && height[2]>=height[3]){result++;} if(height[3]>=height[0] && height[3]>=height[1] && height[3]>=height[2]){result++;} System.out.println(result); } }