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[] types = new int[n]; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } int typ1=0; int typ2=0; int typ3=0; int typ4=0; int typ5=0; for(int i=0;ilst[k]){ temp=lst[k]; lst[k]=lst[j]; lst[j]=temp; } } } if(lst[4]==typ1){ System.out.println(1); } else if(lst[4]==typ2){ System.out.println(2); } else if(lst[4]==typ3){ System.out.println(3); } else if(lst[4]==typ4){ System.out.println(4); } else if(lst[4]==typ5){ System.out.println(5); } // your code goes here } }