h,n=map(int,input().split()) c=sum([int(input())>h for _ in range(n-1)]) print(str(c+1)+('st','nd','rd')[c%10] if 0<(c+1)%10<4 else str(c+1)+'th')