#include #include using namespace std; bool read_positive() { char top = ' ', bot; cin >> top >> bot; return top == '+'; } int main() { int flips_needed = 0; bool last_positive = read_positive(); string line; getline(cin, line); for (int i = 2; i < line.size(); i += 2) { if (line[i] != line[i-2] && line[i] == '-') flips_needed++; } std::cout << flips_needed << std::endl; return 0; }