#include #include using namespace std; int main() { vector fish(300); for(int i = 0; i < 300; i++) cin >> fish[i]; for(int i = 0; i < 80; i++) { int new_fish_count = 0; for(int j = 0; j < fish.size(); j++) { if (--fish[j] < 0) { fish[j] = 6; new_fish_count++; } } vector new_fish(new_fish_count, 8); fish.insert(fish.end(), new_fish.begin(), new_fish.end()); } cout << fish.size() << endl; return 0; }