#include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i, a, b) for(int i=(a);i<=(b);i++) #define RFOR(i, a, b) for(int i=(a);i>=(b);i--) #define MOD 1000000007 #define INF 1000000000 using namespace std; int main(void) { int H, n; int h[101]; int p = 0; cin >> H >> n; FOR(i, 0, n - 2) { cin >> h[i]; } sort(h, h + n-1); RFOR(i, n - 2, 0) { p++; if (H > h[i]) { break; } if (i == 0) { p = n; break; } } switch (p % 10) { case 1: cout << p << "st" << endl; break; case 2: cout << p << "nd" << endl; break; case 3: cout << p << "rd" << endl; break; default: cout << p << "th" << endl; break; } return 0; }