#include using namespace std; int main(void) { int h, n; cin >> h >> n; vector H(n - 1); for (int i = 0; i < n - 1; i++) { cin >> H[i]; } sort(H.begin(), H.end(), greater()); int ans = n; for (int i = 0; i < n - 1; i++) { if (h < H[i]) continue; ans = i + 1; break; } if (ans % 10 == 1) { cout << ans << "st\n"; } else if (ans % 10 == 2) { cout << ans << "nd\n"; } else if (ans % 10 == 3) { cout << ans << "rd\n"; } else { cout << ans << "th\n"; } return 0; }