#include <iostream>
#include <map>
#include <iostream>
using namespace std;
int main(){
int tmp;
map<int, int> data;
while(cin >> tmp){
if(data.count(tmp)){
data[tmp]++;
}else{
data.insert(pair<int, int>(tmp, 1));
}
}
int count = 0;
for(auto i : data){
if(i.second <= 0)
continue;
count += i.second / (i.first + 1)*(i.first + 1);
if(i.second % (i.first +1) != 0){
count += (i.first +1);
}
}
cout << count << endl;
return 0;
}