import java.util.*; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int H = in.nextInt(); int N = in.nextInt(); int ans = 1; for (int i = 0; i < N-1; i++) { int hi = in.nextInt(); if (H < hi) { ans++; } } if (ans%10 == 1) { System.out.println(ans + "st"); } else if (ans%10 == 2) { System.out.println(ans + "nd"); } else if (ans%10 == 3) { System.out.println(ans + "rd"); } else { System.out.println(ans + "th"); } } }