fun main() {
    // Read input
    val number: String = readln()

    // Run a DP, with start index, prefix with '-'
    val n = number.length
    val dp = Array<DoubleArray>(n + 1) { DoubleArray(2) }
    for (i in n - 1 downTo 0) {
        for (p in 0..1) {
            var current = 0.0
            var prob = (if (p == 0) 1 else -1).toDouble()
            var j = 0
            while (i + j < n) {
                current += prob * (number.get(i + j).code - '0'.code)
                // We get a +
                dp[i][p] += 0.45 * (current + prob * dp[i + j + 1][0])
                // We get a -
                dp[i][p] += 0.45 * (current + prob * dp[i + j + 1][1])
                // We get no + or -
                prob *= 0.1
                j++
            }
            // End with a number
            dp[i][p] += current / 10
        }
    }

    println(dp[0][0])
}