#include #include #include using namespace std; class Solution { long best = -1; long curtotal = 0; public: void addItem(long cals) { curtotal += cals; } void endElf() { best = max(best, curtotal); curtotal = 0; } long getAnswer() { return best; } }; int main() { Solution sol; for (string line; getline(cin, line); ) { if (line.length() > 0) { sol.addItem(stol(line)); } else { sol.endElf(); } } sol.endElf(); cout << sol.getAnswer() << endl; }