import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int h = scan.nextInt(); int N = scan.nextInt(); int []H = new int[N - 1]; for(int i = 0; i < N - 1; i++) { H[i] = scan.nextInt(); } scan.close(); Arrays.sort(H); for(int i = N - 2; i >= 0; i--){ if(h >= H[i]) { String k = Integer.toString(N - i - 1); int ans = N - i - 1; int l = k.length(); if(k.charAt(l - 1) == '1') { System.out.println(ans + "st"); break; }else if(k.charAt(l - 1) == '2') { System.out.println(ans + "nd"); break; }else if(k.charAt(l - 1) == '3') { System.out.println(ans + "rd"); break; }else { System.out.println(ans + "th"); break; } } } if(h < H[0]) { System.out.println(N + "th"); } } }