'use strict'

function main(input) {
  input = input
    .trim()
    .split('')
    .map(Number)

  const ans = input.reduce((a, b) => a + b)

  console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
