#include #include #include #include #include int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); int t; std::cin >> t; for(int i=0; i> n; std::map lNumMap; for(int j=0; j> input; ++lNumMap[input]; } std::vector> lNumPair(2, std::make_pair(0, 0)); for(auto it=lNumMap.begin(); it!=lNumMap.end(); ++it){ lNumPair.push_back(std::make_pair(it->first, it->second)); } int ans = 0; while(true){ std::sort(lNumPair.begin(), lNumPair.end(), [](const std::pair& l, std::pair& r){ return l.second>r.second; }); if(lNumPair[2].second==0) break; for(int j=0; j<3; ++j){ --lNumPair[j].second; } ++ans; } std::cout << ans << "\n"; } return 0; }