#include <fstream>
#include <string>
using namespace std;

int main () {
	ifstream fin;
	ofstream fout;
	fin.open("DATA2.txt");
	fout.open("OUT2.txt");

	string temp;
	bool check;
	int bal=0;
	for (int i=1;i<=5;i++) {
		check=true;
		getline(fin,temp);
		for (int j=0;j<temp.length();j++) {
			if (temp[j] == '+')
				bal++;
			else bal--;
			if (bal < 0) {
				bal=0;
				fout << "OH NOES!\n";
				check=false;
				break;
			}
		}
		if (check)
			fout << bal << "\n";
	}
	fin.close();
	fout.close();
	return 0;
}
