#include #include #include using namespace std; int main() { vector v{istream_iterator(cin), {}}; auto w = v; int p1 = 0, p2 = 0; for (unsigned int pc = 0; pc < v.size(); p1++) pc += v[pc]++; for (unsigned int pc = 0; pc < v.size(); p2++) pc += w[pc] >= 3 ? w[pc]-- : w[pc]++; cout << p1 << endl << p2 << endl; }