// SumDoubleHex.java

public class SumDoubleHex {

    public static void main(String[] args) {
        double sum = 0;
        for (String argument : args) {
            StringBuilder number = new StringBuilder();
            for (char c : argument.toCharArray()) {
                if (!Character.isWhitespace(c)) {
                    number.append(c);
                } else {
                    sum += parseNumber(number);
                    number = new StringBuilder();
                }
            }

            sum += parseNumber(number);
        }

        System.out.println(sum);
    }

    static double parseNumber(StringBuilder number) {
        if (!number.isEmpty()) {
            String numberString = number.toString();
            if (
                numberString.startsWith("0x") || numberString.startsWith("0X")
            ) {
                if (numberString.contains(".")) {
                    return Double.parseDouble(numberString);
                }
                return Long.parseLong(numberString.substring(2), 16);
            } else {
                return Double.parseDouble(numberString);
            }
        } else {
            return 0;
        }
    }
}
