Problem: Polycarpus just has been out of luck lately! As soon as he found a job in the "Binary Cat" cafe, the club got burgled. All ice-cream was stolen.

On the burglary night Polycarpus kept a careful record of all club visitors. Each time a visitor entered the club, Polycarpus put down character "+" in his notes. Similarly, each time a visitor left the club, Polycarpus put character "-" in his notes. We know that all cases of going in and out happened consecutively, that is, no two events happened at the same time. Polycarpus doesn't remember whether there was somebody in the club at the moment when his shift begun and at the moment when it ended.

Right now the police wonders what minimum number of distinct people Polycarpus could have seen. Assume that he sees anybody coming in or out of the club. Each person could have come in or out an arbitrary number of times.

Input

The only line of the input contains a sequence of characters "+" and "-", the characters are written one after another without any separators. The characters are written in the order, in which the corresponding events occurred. The given sequence has length from 1 to 300 characters, inclusive.

Output

Print the sought minimum number of people

Examples

Input

+-+-+


Output

1


Input

---

Output

3

Solution (in JAVA):

Solution:
import java.util.*;
import java.io.*;
/*

 */
public class eight 
{	
	public static void main(String[] arg) throws IOException
	{
		new eight();
	}
	
	public eight() throws IOException
	{
		//JoltyScanner in = new JoltyScanner(System.in);
		//FastInput in = new FastInput(System.in);
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String str = in.next();
		int max = 1;
		int curOutside = 0;
		int curInside = 0;
		if(str.charAt(0) == '+') curInside++;
		else curOutside++;
		
		for(int i = 1; i < str.length(); i++)
		{
			char ch = str.charAt(i);
			if(ch == '+')
			{
				if(curOutside > 0)
				{
					curOutside--;
					curInside++;
				}
				else
				{
					max++;
					curInside++;
				}
			}
			else
			{
				if(curInside > 0)
				{
					curInside--;
					curOutside++;
				}
				else
				{
					max++;
					curOutside++;
				}
			}
		}
		out.println(max);
		in.close(); out.close();
	}
	class FastInput 
	{
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		public FastInput(InputStream input)
		{
			reader = new BufferedReader(new InputStreamReader(input));
			tokenizer = new StringTokenizer("");
		}
		String next() throws IOException
		{
			while( ! tokenizer.hasMoreTokens() )
			{
				tokenizer = new StringTokenizer(reader.readLine());
			}
			return tokenizer.nextToken();
		}
		char nextChar() throws IOException { return next().charAt(0); }
		int nextInt() throws IOException { return Integer.parseInt(next()); }
		double nextDouble() throws IOException { return Double.parseDouble(next()); }
		long nextLong() throws IOException { return Long.parseLong(next()); }
		void close() throws IOException { reader.close(); }
	}
	class JoltyScanner 
	{
	    public static final int BUFFER_SIZE = 1 << 16;
		public static final char NULL_CHAR = (char) -1;

	    byte[] buffer = new byte[BUFFER_SIZE];
		boolean EOF_FLAG = false;
		int bufferIdx = 0, size = 0;
		char c = NULL_CHAR;
		BufferedInputStream in;

		public JoltyScanner(InputStream in) 
		{
			this.in = new BufferedInputStream(in, BUFFER_SIZE);
		}

		public int nextInt() 
		{
			long x = nextLong();
			if (x > Integer.MAX_VALUE || x < Integer.MIN_VALUE) 
			{
				throw new ArithmeticException("Scanned value overflows integer");
			}
			return (int) x;
		}

		public long nextLong() 
		{
			boolean negative = false;
			if (c == NULL_CHAR) 
			{
				c = nextChar();
			}
			for (; !EOF_FLAG && (c < '0' || c > '9'); c = nextChar()) 
			{
				if (c == '-') 
				{
					negative = true;
				}				
			}
			checkEOF();
			long res = 0;
			for (; c >= '0' && c <= '9'; c = nextChar()) 
			{
				res = (res << 3) + (res << 1) + c - '0';
			}
			return negative ? -res : res;
		}

	    public char nextChar() 
	    {
			if (EOF_FLAG) 
			{
				return NULL_CHAR;
			}
			while (bufferIdx == size) 
			{
				try 
				{
					size = in.read(buffer);
					if (size == -1) 
					{
						throw new Exception();
					}
				} 
				catch (Exception e) 
				{
					EOF_FLAG = true;
					return NULL_CHAR;
				}
				if (size == -1) 
				{
					size = BUFFER_SIZE;
				}
				bufferIdx = 0;
			}
			return (char) buffer[bufferIdx++];
		}

	    public void checkEOF() 
	    {
			if (EOF_FLAG) 
			{
				throw new EndOfFileException();
			}
		}
	    public void close()
	    {
	    	;
	    }
		public class EndOfFileException extends RuntimeException 
		{
		}
	}
	class FastScanner 
	{
		final BufferedReader reader;
		String line;
		int index;
		public FastScanner(InputStream in)
		{
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String readLine()
		{
			try
			{
				String line = reader.readLine();
				if(line == null) throw new IOException("End of stream");
				return line;
			}
			catch(IOException exception)
			{
				throw new RuntimeException(exception);
			}
		}
		public String nextLine()
		{
			if(line==null) return readLine();
			String s = line;
			line = null;
			return s.substring(index);
		}
		public String next()
		{
			if(line == null)
			{
				line = readLine();
				index = 0;
			}
			while(index >= line.length())
			{
				line = readLine();
				index = 0;
			}
			while(Character.isWhitespace(line.charAt(index)))
			{
				index++;
				while(index >= line.length())
				{
					line = readLine();
					index = 0;
				}
			}
			int endIndex = index;
			while(endIndex < line.length() && !Character.isWhitespace(line.charAt(endIndex)))
				endIndex++;
			String s = line.substring(index, endIndex);
			index = endIndex;
			return s;
		}
		public int nextInt() { return Integer.parseInt(next()); }
		public long nextLong() { return Long.parseLong(next()); }
		public double nextDouble() { return Double.parseDouble(next()); }
		public void close() {;}
	}
}