tailrec fun solve(cubes: String,acc:Int = 0): Int {
    val N = cubes.length
    val valid_indices = 0.until(N-1).filter {
        (cubes[it] == '0' && cubes[it+1] == '1') || (cubes[it] == '1' && cubes[it+1] == '0')
    }

    return if (valid_indices.size == 0) {
        acc
    } else {
        valid_indices.map {
            solve(cubes.substring(0,it) + cubes.substring(it+1),acc + 2)
        }.max()!!
    }
}

fun main(args:Array<String>) {
    val S = readLine()!!    
    solve(S).run(::println)
}