#include using namespace std; int main() { bool start; bool previous; bool next; char in; int out = 0; cin >> in; if(in == '+') start = 1; else start = 0; previous = start; while(cin >> in) { if(in == '+') next = 1; else next = 0; if((previous != next) && (start == next)) { out++; } previous = next; cin >> in; } cout << out << endl; return 0; }