#include using namespace std; int main(){ int H, N; cin >> H >> N; vector h(N - 1); for(auto &hi : h) cin >> hi; sort(h.begin(), h.end()); int ans = N - (lower_bound(h.begin(), h.end(), H) - h.begin()); if(ans % 10 == 1) cout << ans << "st" << endl; else if(ans % 10 == 2) cout << ans << "nd" << endl; else if(ans % 10 == 3) cout << ans << "rd" << endl; else cout << ans << "th" << endl; }