s = io.read() a = 0 for i = 1, #s do a = a + tonumber(s:sub(i, i)) end print(a)