//DWITE

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{
	//vars
	ifstream f ("DATA22.txt");
	ofstream g ("OUT2.txt");
	int t,a,cur;
	string s;
	cur=0;
		for (t=0; t<5; t++)
		{
			f >> s;
				for (a=0; a<s.length();  a++)
					if (s[a]=='+')
						cur++;
					else
					{
						cur--;
							if (cur<0)
							{
								g << "OH NOES!" << endl;
								cur=0;
								goto skip;
							}
					}
			g << cur << endl;
skip:
			t=t;
		}
	return(0);
}
