program sum
implicit none
integer::n, a, b, c, d ,e ,ans
 
read(5,*)n
 
 if(n==10.or.n==100.or.n==1000.or.n==10000.or.n==100000) then  
  ans=10
 else
  a=n/10000
  b=n/1000-10*a
  c=n/100-10*b-100*a
  d=n/10-10*c-100*b-1000*a
  e=n-10*d-100*c-1000*b-10000*a
  ans=a+b+c+d+e
endif
 
write(6,*)ans
 
end program sum