# Filter out and add up

The task is very simple. Given a non-empty string containing numbers, uppercase and lowercase letters, output the sum of the remaining numbers. For example:

a1wAD5qw45REs5Fw4eRQR33wqe4WE


Filtering out all the letters would result into:

 1   5  45   5  4    33   4


The sum of these numbers is 1 + 5 + 45 + 5 + 4 + 33 + 4 = 97. So the output would be 97.

### Test Cases

a > 0
0 > 0
5 > 5
10 > 10
a0A > 0
1a1 > 2
11a1 > 12
4dasQWE65asAs5dAa5dWD > 79


This is , so the submission with the least amount of bytes wins!

• I knew I had written that Labyrinth program before... here is the same challenge but with negative numbers as well (which makes a surprisingly big difference for some languages, so I don't think they're dupes). Feb 12 '16 at 18:06
• @MartinBüttner Looks like that one doesn't include negative numbers: "-n (where n is an integer) is not counted as a negative n, but as a hyphen followed by n."
– Paul
Feb 13 '16 at 3:18
• Oh, I see what you mean. You're saying it has hyphens and this one doesn't.
– Paul
Feb 13 '16 at 3:20

# Python 2, 71 bytes

I just had to make one-liner, though it costs a whole byte more than @TanMath's answer

sum(map(int,"".join([i*i.isdigit()or" "for i in raw_input()]).split()))


Explaination:

raw_input()                             - Input
"".join([i*i.isdigit()or" "for i in _]) - Replace non-digits with spaces
map(int, _.split())                     - Split on spaces, and convert to number
sum(_)                                  - Sum the resulting list