#include using namespace std; int main() { int H, n; cin >> H >> n; int h[n]; h[0] = H; for(int i = 1; i < n; ++i) { cin >> h[i]; } sort(h, h + n); reverse(h, h + n); int ans; for(int i = 0; i < n; ++i) { if(h[i] == H) { ans = i + 1; } } string s; if(ans % 10 == 1) s = "st"; else if(ans % 10 == 2) s = "nd"; else if(ans % 10 == 3) s = "rd"; else s = "th"; cout << ans << s << '\n'; return 0; }