#include #define REP(i, a, n) for(ll i = ((ll) a); i < n; i++) using namespace std; typedef long long ll; ll H, N, A[1000]; int main(void) { cin >> H >> N; N--; REP(i, 0, N) cin >> A[i]; sort(A, A + N); ll ans = (A + N) - lower_bound(A, A + N, H) + 1; 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; }