import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Collections; public class No00000564_Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { String[] hn = br.readLine().split(" "); int h = Integer.parseInt(hn[0]); int n = Integer.parseInt(hn[1]); Integer[] l = new Integer[n-1]; for(int i = 0;i < n - 1; i++) { l[i] = Integer.parseInt(br.readLine()); } Arrays.sort(l, Collections.reverseOrder()); int r = n; for(int j = 0; j < n - 1; j++) { if(l[j] < h) { r = j + 1; break; } } if(r % 10 == 1) System.out.println(r + "st"); if(r % 10 == 2) System.out.println(r + "nd"); if(r % 10 == 3) System.out.println(r + "rd"); if(r % 10 > 3) System.out.println(r + "th"); } }