#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0;(i)<(n);(i)++) #define ll long long int main() { int h, N; int H[102]; cin >> h >> N; REP(i, N) { if (i == 0) { H[i] = h; continue; } cin >> H[i]; } sort(H, H + N); int a = 0; REP(i, N) { if (H[i] == h) a = i+1; } a = N - a + 1; int b; if ((a - 1) % 10 == 0) b = 1; else if ((a - 2) % 10 == 0)b = 2; else if ((a - 3) % 10 == 0) b = 3; else a = 4; cout << a << (a==1?"st":(a==2?"nd":(a==3?"rd":"th"))) << endl; return 0; }