#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline string ord(int i) { if (i % 10 == 1 && i != 11) return to_string(i) + "st"; if (i % 10 == 2 && i != 12) return to_string(i) + "nd"; if (i % 10 == 3 && i != 13) return to_string(i) + "rd"; return to_string(i) + "th"; } int main() { int h, n; cin >> h >> n; vector a(n); rep(i, n - 1) cin >> a[i]; a.back() = h; sort(a.begin(), a.end()); cout << ord(n - (lower_bound(a.begin(), a.end(), h) - a.begin())) << endl; return 0; }