Sum integers in a string Input

A string.

Output

The sum of all integers in the line.

Constraints

1≤Length of line≤500

Sample test Case

Input

the 5is 108 seCONd4 a


Output

117


Explanation

Sum is: 5+108+4=117
05AB1E (legacy), 5 bytes
.œþOà

Try it online or verify a few more test cases. (Times out for the larger test cases due to the .œ builtin.)
05AB1E, 11 6 bytes
þмS¡þO

Try it online or verify a few more test cases.
Explanation:

.œ      # Get all partitions of the (implicit) input-string,
        # which are all possible ways of dividing the input-strings into substrings
  þ     # Only leave the items consisting of digits for each partition
        # (in the new version of 05AB1E, an explicit `€` is required)
   O    # Sum each inner list
    à   # Pop and push its maximum
        # (after which the result is output implicitly)

þм      # Only leave the non-digits of the (implicit) input-string
        #  i.e. &quot;the 5is 108 seCONd4 a&quot; → &quot;the is  seCONd a&quot;
  S     # Split it into a list of characters
        #  → [&quot;t&quot;,&quot;h&quot;,&quot;e&quot;,&quot; &quot;,&quot;i&quot;,&quot;s&quot;,&quot; &quot;,&quot; &quot;,&quot;s&quot;,&quot;e&quot;,&quot;C&quot;,&quot;O&quot;,&quot;N&quot;,&quot;d&quot;,&quot; &quot;,&quot;a&quot;]
   ¡    # Split the (implicit) input-string by each of these characters
        #  → [&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;5&quot;,&quot;&quot;,&quot;&quot;,&quot;108&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;4&quot;,&quot;&quot;,&quot;&quot;]
    þ   # Remove the empty strings by only leaving the digits
        #  → [&quot;5&quot;,&quot;108&quot;,&quot;4&quot;]
     O  # And sum these numbers (which is output implicitly)
        #  → 117