#include using namespace std; typedef long long ll; int main() { int h, n; cin >> h >> n; int a[n]; a[0] = h; for (int i = 1; i < n; i++) cin >> a[i]; sort(a, a+n); reverse(a, a+n); for (int i = 0; i < n; i++) if (a[i] == h) { i++; cout << i; if (i % 10 == 1) cout << "st\n"; else if (i % 10 == 2) cout << "nd\n"; else if (i % 10 == 3) cout << "rd\n"; else cout << "th\n"; break; } return 0; }