fork download
  1. n = int(input())
  2.  
  3. a = n // 1000
  4. b = (n // 100) % 10
  5. c = (n // 10) % 10
  6. d = n % 10
  7.  
  8. print(a + b + c + d)
  9.  
Success #stdin #stdout 0.01s 7232KB
stdin
1234
stdout
10