Problem9683--ABC187 —— A - Large Digits

9683: ABC187 —— A - Large Digits

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 512 MiB

Description

For an integer $n$, let $S(n)$ be the sum of digits in the decimal notation of $n$. For example, we have $S(123) = 1 + 2 + 3 = 6$.

Given two $3$-digit integers $A$ and $B$, find the greater of $S(A)$ and $S(B)$.

Input

Input is given from Standard Input in the following format:

```
$A$ $B$
```

Output

Print the value of the greater of $S(A)$ and $S(B)$.  
If these are equal, print $S(A)$.

Constraints

-   All values in input are integers.
-   $100 \le A, B \le 999$

Sample 1 Input

123 234

Sample 1 Output

9
We have S(123)=1+2+3=6 and S(234)=2+3+4=9, so we should print the greater of these: 9.

Sample 2 Input

593 953

Sample 2 Output

17

Sample 3 Input

100 999

Sample 3 Output

27

Source/Category