#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int M, a;
vector<int> v;
cin >> M;
for (int i = 0; i < M; i++)
{
cin >> a;
v.push_back(a);
}
sort(v.begin(), v.end(), greater<int>());
for (int i = 0; i < M; i++)
{
if (v[i]<i+1)
{
cout << i << endl;
break;
}
}
system("pause");
return 0;
}
网友评论