def solve(s) s.chars.map( &:to_i ).inject(0){ |a,e| a+e } end p solve(gets)