Sum of digits in string in java