from bisect import bisect_left h,n,*a = map(int,open(0).read().split()) a.sort() ans = n-bisect_left(a,h) end = ["th","st","nd","rd"]+["th"]*9 print(str(ans)+end[ans%10])