import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int n = sc.nextInt(); int[] height = new int[n - 1]; for(int i = 0; i < n - 1; i++) { height[i] = sc.nextInt(); } Arrays.sort(height); int ord = n; for(int i = n - 2; i >= 0; i--) { if(height[i] < h) { ord = n - i - 1; break; } } String ans = ""; if(ord == 1) { ans = "1st"; } else if(ord == 2) { ans = "2nd"; } else if(ord == 3) { ans = "3rd"; } else { ans = ord + "th"; } System.out.println(ans); } }