local s = io.stdin:read("*l") local r = 0 for i=1,#s do r = r + tonumber(s:sub(i,i)) end print(r)