There is a custom summary function needed as to receive an integer input (e.g. `32456`) and returns `3+2+4+5+6`. Can you think of any other (or better) solution besides this?

```
public class CustomSum {
    public int sum(int input) {
        int sum = 0;

        while ( input >= 1 ) {
            sum += input % 10;
            input = input / 10;
        }

        return sum;
    }

    public static void main(String[] args) {
        int input = Integer.parseInt(args[0]); //assuming args[0] is integer

        CustomSum c = new CustomSum();
        int sum = c.sum(input);

        System.out.println("sum: " + sum);
    }
}

```

In every iteration I intended to extract the right digit by `input % 10`, and omit the extracted right digit for next iteration by `input / 10`. Now consider when we are in last iteration and have a 1 digit number. The `input / 10` would be greater than 0 and less than 1 (if actually it was `float` or `double` not `int`). So I didn't actually changed that specific condition, although with `int` it will always be `0`.