h, n = map(int, input().split()) H = [int(input()) for i in range(n-1)] H.sort() import bisect i = n-bisect.bisect_left(H, h) if i%10 == 1: print(str(i)+'st') elif i%10 == 2: print(str(i)+'nd') elif i%10 == 3: print(str(i)+'rd') else: print(str(i)+'th')