from bisect import bisect H, N = map(int, input().split()) a = sorted([int(input()) for _ in [0]*(N-1)]) ans = str(N-bisect(a, H)) print(ans+(["st", "nd", "rd"][int(ans[-1])-1] if 0 < int(ans[-1]) < 4 else "th"))