import java.util.*; public class New { public static void main(String[] arg){ Scanner sc = new Scanner(System.in); int n,count=0; n = sc.nextInt(); int[] a = new int[n]; for(int i = 0; i< n;i++){ a[i] = sc.nextInt(); } Arrays.sort(a); if(n>1){ if(a[0] != a[1])count++; for(int i = 0;i3){ if(a[n-2] != a[n-1])count++; } }else{ count++; } System.out.println(count); } }