import java.io.*;
import java.awt.*;
public class problem2
{
    public static void main (String[] args) throws IOException
    {
	String line;
	int total = 0;
	int a = 0;
	int len;
	BufferedReader inputBR;
	FileReader inputFR;
	inputFR = new FileReader ("DATA2.txt");
	inputBR = new BufferedReader (inputFR);
	// the BufferedReader and FileReader are classess from java.io
	PrintWriter outputPW;
	FileWriter outputFW;
	// outputPW is an identfier for the PrintWriter class
	//outputFW is an identfier for the FileWriter class
	outputFW = new FileWriter ("OUT2.txt");
	// "OUT2" is the name of the text file
	outputPW = new PrintWriter (outputFW);
	// FileWriter is a class inside of the class PrintWriter
	// classes can be nested inside of other classes in java
	for (int i = 1 ; i <= 5 ; i++)
	{
	    line = inputBR.readLine ();
	    len = line.length ();
	    if (len > 255)
	    {
		System.out.println ("Out of range, It's should be no more than 255 characters");
		break;
	    }
	    for (a = 0 ; a < len ; a++)
	    {
		if (line.charAt (a) == '+')
		{
		    total++;
		}
		if (line.charAt (a) == '-')
		{
		    total--;
		    if (total < 0)
		    {
			outputPW.println ("OH NOES!");
			total = 0;
			break;
		    }
		}
	    }
	    outputPW.println (total);
	}
	outputFW.close ();
	outputPW.close ();
    }
}

