#C8171. Minimize Sum of Integers

    ID: 52124 Type: Default 1000ms 256MiB

Minimize Sum of Integers

Minimize Sum of Integers

Given a string (s) consisting solely of digit characters (0-9), your task is to partition the string into one or more integers such that the sum of these integers is minimized. Note that concatenating digits to form larger numbers will always result in a larger value than summing the individual digits. For example, for the string "12", the integer 12 is greater than (1 + 2). Therefore, the minimum sum is obtained by treating each digit independently. In other words, the answer is the sum of all the digits in (s).

inputFormat

The input consists of a single line containing a non-empty string (s) of digits (0-9).

outputFormat

Output a single integer which is the minimum sum obtainable by splitting the string into individual digits and summing them.## sample

5
5