import java.util.Scanner;

public class Journals {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();

        int positives = 0;
        int negatives = 0;
        int i = 0;
        while (i < line.length()) {
            if (line.charAt(i) == '+' && line.charAt(i + 1) == '-') {
                while (i < line.length() && line.charAt(i) == '+' && line.charAt(i + 1) == '-') {
                    i += 2;
                }
                ++positives;
            } else {
                while (i < line.length() && line.charAt(i) == '-' && line.charAt(i + 1) == '+') {
                    i += 2;
                }
                ++negatives;
            }
        }
        System.out.println(Math.min(positives, negatives));
    }
}
