#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; struct BoolName : numpunct { string t, f; BoolName (string t = "Yes", string f = "No") : t(t), f(f) {} string do_truename() const {return t;} string do_falsename() const {return f;} }; struct Initializer { Initializer() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15) << boolalpha; cout.imbue(locale(cout.getloc(), new BoolName)); } } initializer; template istream& operator>>(istream &s, vector &v) { for (T &t : v) s >> t; return s; } template ostream& operator<<(ostream &s, const vector &v) { for (const T &t : v) s << t << endl; return s; } void set_bool_name(string t, string f) { cout.imbue(locale(cout.getloc(), new BoolName(t, f))); } int main() { int h, n, r = 1; cin >> h >> n; vector v(n - 1); cin >> v; for (int i : v) { if (i > h) ++r; } cout << r; if (r % 10 == 1) cout << "st" << endl; else if (r % 10 == 2) cout << "nd" << endl; else if (r % 10 == 3) cout << "rd" << endl; else cout << "th" << endl; }