output_description: Print the minimum possible value of "the sum of the digits of A" plus "the sum
  of the digits of B".
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: #!/usr/bin/env python3
  from collections import defaultdict, deque
  from heapq import heappush, heappop
  from bisect import bisect_left, bisect_right
  import sys, random, itertools, math
  
  sys.setrecursionlimit(10**5)
  input = sys.stdin.readline
  sqrt = math.sqrt
  
  
  def LI():
      return list(map(int, input().split()))
  
  
  def LF():
      return list(map(float, input().split()))
  
  
  def LI_():
      return list(map(lambda x: int(x) - 1, input().split()))
  
  
  def II():
      return int(input())
  
  
  def IF():
      return float(input())
  
  
  def LS():
      return list(map(list, input().split()))
  
  
  def S():
      return list(input().rstrip())
  
  
  def IR(n):
      return [II() for _ in range(n)]
  
  
  def LIR(n):
      return [LI() for _ in range(n)]
  
  
  def FR(n):
      return [IF() for _ in range(n)]
  
  
  def LFR(n):
      return [LI() for _ in range(n)]
  
  
  def LIR_(n):
      return [LI_() for _ in range(n)]
  
  
  def SR(n):
      return [S() for _ in range(n)]
  
  
  def LSR(n):
      return [LS() for _ in range(n)]
  
  
  mod = 1000000007
  inf = 1e10
  
  
  # solve
  def solve():
      n = input().rstrip()
      ans = sum(map(int, list(n)))
      if int(n) == 10 ** (len(n) - 1):
          ans = 10
      print(ans)
      return
  
  
  # main
  if __name__ == "__main__":
      solve()
  
problem_description: 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).
samples: [{"input": "15", "output": "6\n    \n\nWhen A=2 and B=13, the sums of their digits are 2 and 4, which minimizes the\nvalue in question.\n\n* * *"}, {"input": "100000", "output": "10"}]