// Sum.java

public class Sum {

    public static void main(String[] args) {
        int sum = 0;
        for (String argument : args) {
            StringBuilder number = new StringBuilder(); // we will form numbers here using StringBuilder
            for (char c : argument.toCharArray()) {
                if (!Character.isWhitespace(c)) {
                    // if character is not whitespace
                    number.append(c); // concatenate new digit
                } else {
                    // if character is whitespace
                    if (!number.isEmpty()) {
                        // if number is not empty
                        sum += Integer.parseInt(number.toString()); // add number to sum
                    }
                    number = new StringBuilder(); // empty the number by creating new empty StringBuilder
                }
            }

            // check for any remaining digits in number
            if (!number.isEmpty()) {
                // if number is not empty
                sum += Integer.parseInt(number.toString()); // add number to sum
            }
        }

        System.out.println(sum);
    }
}
