#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { int ans; int H,N; cin >> H >> N; vector HV(N); for ( int i = 0; i < N-1; i++ ) { cin >> HV[i]; } HV[N-1] = H; sort( HV.begin(), HV.end(), greater() ); for ( int i = 0; i < N; i++ ) { if ( HV[i] == H ) { ans = i+1; break; } } 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; } return 0; }