import java.util.*; import java.util.stream.Stream; import java.time.*; import java.time.format.*; public class No564 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int n = sc.nextInt(); Integer[] hh = new Integer[n]; for(int i = 0; i < n - 1; i++) { hh[i] = sc.nextInt(); } hh[n - 1] = h; Arrays.sort(hh, Collections.reverseOrder()); for(int i = 0; i < n; i++) { if(h == hh[i]) { if(i == 0) { System.out.println(i + 1 + "st"); }else if(i%10 == 1) { System.out.println(i + 1 + "nd"); }else if(i%10 == 2) { System.out.println(i + 1 + "rd"); }else { System.out.println(i + 1 + "th"); } return; } } } }