import java.io.*;
import java.util.*;

// The "Template" class.
public class ShowMeTheMoney
{
    public static void main (String[] args) throws IOException
    {
	// Open up the input and output file for IO purpose
	FileReader inFile = new FileReader ("DATA2.txt");
	FileWriter outFile = new FileWriter ("OUT2.txt");

	// Link the input and output file for
	BufferedReader in = new BufferedReader (inFile);
	BufferedWriter out = new BufferedWriter (outFile);

	int balance = 0;
	String input = "", line;
	String temp = "";

	boolean ohnoes = false;

	// Keep reading as long as not end of file (eof)
	while ((line = in.readLine ()) != null)
	{
	    for (int i = 0 ; i != line.length () ; i++)
	    {
		temp = line.substring (i, i + 1);

		if (temp.equals ("+"))
		    balance += 1;
		else if (temp.equals ("-"))
		    balance -= 1;

		if (balance < 0)
		{
		    out.write ("OH NOES!");
		    ohnoes = true;
		    balance = 0;
		    break;
		}
	    }

	    if (ohnoes != true)
		out.write (Integer.toString(balance));

	    //balance = 0;
	    out.newLine();
	    ohnoes = false;
	}

	// Close input and output file
	in.close ();
	out.close ();

    } // main method
} // End of Class

