a=$<.map &:hex;print 1+i=a.count{|e|e>a[0]},%i[st nd rd][i%10]||:th