Problem:
Score : 200 points

Problem Statement

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".

Sample Input 1

15

Sample Output 1

6

When A=2 and B=13, the sums of their digits are 2 and 4, which minimizes the value in question.

Sample Input 2

100000

Sample Output 2

10

Solution in Ruby (2.3.3) (judge verdict: Wrong Answer)

def bitwise_and(a, b)
  (a.to_i(2) & b.to_i(2)).to_s(2)
end

input_array = gets.to_s.gsub(/\s+/m, ' ').strip.split(" ")
input_array.push(gets.to_s.gsub(/\s+/m, ''))
input_array.push(gets.to_s.gsub(/\s+/m, ''))



# 1行目の1つ目が N
# n = input_array[0]

# 1行目の2つめが M
# m = input_array[1]

# 1行目の3つめが K
k = input_array[2]

# 2行目の文字が S = x
x_bite = input_array[3]

# 3行目の文字が T = y
y_bite = input_array[4]


(1..(k.to_i)).each do |n|
  z = bitwise_and(x_bite, y_bite)
  x_int = z.to_i(2) + x_bite.to_i(2)
  y_int = z.to_i(2) + y_bite.to_i(2)
  x_bite = x_int.to_s(2)
  y_bite = y_int.to_s(2)
end

print("#{x_bite}\n#{y_bite}")