#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int h, n, p; cin >> h >> n; string s; vector ht(n); ht[0] = h; for (int i=1; i < n; i++) cin >> ht[i]; sort(ht.begin(), ht.end(), greater()); auto itr = find(ht.begin(), ht.end(), h); p = distance(ht.begin(), itr); s = to_string(p+1); if (s[s.size()-1] == '1') s += "st"; else if (s[s.size()-1] == '2') s += "nd"; else if (s[s.size()-1] == '3') s += "rd"; else s += "th"; cout << s << endl; }