Takahashi has two positive integers A and B.

It is known that A plus B equals N. Find the minimum possible value of "the sum of the digits of A" plus "the sum of the digits of B" (in base 10).

Constraints

* 2 ≤ N ≤ 10^5
* N is an integer.

Input

Input is given from Standard Input in the following format:


N


Output

Print the minimum possible value of "the sum of the digits of A" plus "the sum of the digits of B".

Examples

Input

15


Output

6


Input

100000


Output

10
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 03 21:23:15 2018

@author: ashida
"""

N = input()

if N == 10 or N == 100 or N == 1000 or N == 10000 or N == 100000:
    print(10)
else:
    ans = 0
    a = N
    while(a > 0):
        ans = ans + a - (a/10)*10
        a = a/10
    print(ans)