11737 - Separating numbers and letters   

Description

In this problem, you are given several lines of "magic code", each of which consists of positive integers and English letters. You are asked to extract the positive integers and compute their sum.

Hints:

1. Use strtok(). (https://www.tutorialspoint.com/c_standard_library/c_function_strtok.htm)

2. Use gets(). (http://www.cplusplus.com/reference/cstdio/gets/)

Input

The input has multiple lines, each of which consists of some blocks of numbers and some blocks of English letters (however, could be none) separated by space characters. Each block contains all numbers or all English letters.

Each line contains less than 1000000 characters and the amount of lines is no more than 1000.

Output

For each line, print the sum (int type) of the extracted integers. You do not need to worry about the overflow problem.

Refer to the sample input/output for the details.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss