from bisect import bisect_left h, n = map(int, input().split()) hs = [int(input()) for _ in range(n - 1)] hs.sort() i = bisect_left(hs, h) ans = n - i end = [None, "st", "nd", "rd"] + ["th"] * 7 print(ans, end[ans % 10], sep="")