print((function (h, n) local r = 1 for _=1,n-1 do if h < io.stdin:read("*n") then r = r+1 end end return string.format("%d%s", r, r==1 and "st" or r==2 and "nd" or r==3 and "rd" or "th") end)(io.stdin:read("*n"), io.stdin:read("*n")))