Large Digits

AtCoder
IDabc187_a
Time2000ms
Memory256MB
Difficulty
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)$. ## Constraints * All values in input are integers. * $100 \le A, B \le 999$ ## Input Input is given from Standard Input in the following format: $A$ $B$ [samples]
Samples
Input #1
123 234
Output #1
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$.
Input #2
593 953
Output #2
17
Input #3
100 999
Output #3
27
API Response (JSON)
{
  "problem": {
    "name": "Large Digits",
    "description": {
      "content": "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)$",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc187_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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$.\nGiven two $3$\\-digit integers $A$ and $B$, find the greater of $S(A)$...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments