#include using namespace std; using ll = long long; using ld = long double; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++) const ll mod = 1e9 + 7; const int INF = 1e9; int main() { int H, N; cin >> H >> N; int ans = 1; rep(i, N - 1) { int h; cin >> h; if (H < h)ans++; } cout << ans; if (ans%10 == 1)cout << "st"; else if (ans%10 == 2)cout << "nd"; else if (ans%10 == 3)cout << "rd"; else cout << "th"; cout << endl; return 0; }