let () = Scanf.scanf "%d %d\n" @@ fun h n -> let hrr = Array.init (n-1) @@ fun _ -> Scanf.scanf "%d\n" @@ fun d -> d in let () = Array.fast_sort compare hrr in let ans = Array.fold_left (fun tmp x -> if x > h then tmp+1 else tmp) 1 hrr in let modN = ans mod 10 in Printf.printf "%d%s\n" ans (if modN = 1 then "st" else if modN = 2 then "nd" else if modN = 3 then "rd" else "th")