"use strict";
    
const main = arg => {
    const N = arg.split("\n")[0].split("").map(n=>parseInt(n));
    console.log(N.reduce((m,n)=>m+n));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));