#abc187a. A - Large Digits

A - Large Digits

Score : 100100 points

问题陈述

对于一个整数 nn,让 S(n)S(n) 表示 nn 在十进制表示中的数字之和。例如,我们有 S(123)=1+2+3=6S(123) = 1 + 2 + 3 = 6

给定两个三位数整数 AABB,找出 S(A)S(A)S(B)S(B) 中较大的一个。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

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

Given two 33-digit integers AA and BB, find the greater of S(A)S(A) and S(B)S(B).

Constraints

  • All values in input are integers.
  • 100A,B999100 \le A, B \le 999

Input

Input is given from Standard Input in the following format:

AA BB

Output

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

Sample Input 1

123 234

Sample Output 1

9

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

Sample Input 2

593 953

Sample Output 2

17

Sample Input 3

100 999

Sample Output 3

27