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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main implements Runnable {

	private static void solve() throws IOException {
		String s = next();

		int outcnt = 0;
		int incnt = 0;
		int cnt = 0;

		for (char c : s.toCharArray()) {
			if (c == '+') {
				incnt++;
				if (outcnt < 1) {
					cnt++;
				} else {
					outcnt--;
				}
			} else {
				outcnt++;
				if (incnt < 1) {
					cnt++;
				} else {
					incnt--;
				}
			}
		}
		out.println(cnt);

		// String ret = "";
		// if (s.startsWith("http")) {
		// s = s.substring(4, s.length());
		// // out.println(s);
		// ret += "http://";
		// int i = s.indexOf("ru");
		// ret += s.substring(0, i) + ".ru";
		// s = s.substring(i+2, s.length());
		// // out.println(s);
		// if (s.length() > 0) {
		// ret+="/"+s;
		// }
		// } else {
		// s = s.substring(3, s.length());
		// // out.println(s);
		// ret += "ftp://";
		// int i = s.indexOf("ru");
		// ret += s.substring(0, i) + ".ru";
		// s = s.substring(i+2, s.length());
		// // out.println(s);
		// if (s.length() > 0) {
		// // out.println("shit");
		// ret+="/"+s;
		// }
		// }
		// // if( ret.endsWith("/") ){
		// // ret = ret.substring(0,ret.length()-1);
		// // }
		// out.println(ret);
	}

	private static BufferedReader in;
	private static PrintWriter out;
	private static StringTokenizer st;

	static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	static String next() throws IOException {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null)
				return null;
			eat(line);
		}
		return st.nextToken();
	}

	private static void eat(String s) {
		st = new StringTokenizer(s);
	}

	public static void main(String[] args) {
		new Thread(null, new Main(), "Main", 1 << 27).start();
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			eat("");
			solve();
			in.close();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(566);
		}
	}

}