#include <iostream>
#include <fstream>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <string>
#include <iterator>
#include <algorithm>
#include <numeric>
#include <utility>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <cctype>
#include <assert.h>
#include <list>
#include <ext/hash_set>
#include <ext/hash_map>

using namespace __gnu_cxx;
using namespace std;

#define MP(a,b) make_pair(a,b)
#define i64 long long
#define pb push_back
#define For(i,a,b) for(typeof(a) i=(a);i<(b);i++)
#define Rev(i,a,b) for(typeof(a) i=(a);i>=(b);i--)
#define FOREACH(V,it) for(typeof(V.begin()) it=V.begin();it!=V.end();it++)
#define CLR(a,x) memset(a,x,sizeof(a))
#define ALL(x) x.begin(),x.end()

/**********************************************************************************/

	
int main(){
	ifstream fin ("DATA2.txt"); ofstream fout("OUT2.txt");
	int t=5;
	int cur=0,bad=0; string s;
	while (t--){
		fin >> s;
		bad=0;
		For(i,0,s.size()){
			if (s[i]=='-')  cur--;
			if (s[i]=='+') cur++;
			

			if (cur<0){
				cur=0;
				bad=1; break;

			}

		}
		if (bad) fout << "OH NOES!" << endl; 
		else fout << cur << endl;		
	}		
	return 0;
}
