package main

import "fmt"

func main() {
	var (
		S string
	)
	fmt.Scanf("%s\n", &S)

	fmt.Println(cnt(S))
}


func cnt(s string) int {
	var count int
	if len(s) == 1 {
		return count
	}
	for i := 1; i < len(s); i ++ {
		if s[i-1] == s[i] {
			continue
		}
		count += 2
		return count + cnt(s[:i-1]+s[i+1:])
	}
	return count
}