class ColorfulRabbits { public: int getMinimum(vector <int> re) { map<int, int> m; REP(i, re.SZ) { if(m.find(re[i]+1) == m.end()) m[re[i]+1] = 0; m[re[i]+1]++; } int ans = 0; for( map<int, int>::const_iterator p = m.begin(); p!=m.end(); p++ ) { //cout << p->first << ": " << p->second << " " << endl; ans += (p->second + p->first - 1) / p->first * p->first; } return ans; }