object Main {
	def main(args: Array[String]) {
		val input = io.Source.stdin.getLines().mkString("\n")
		println(solve(input).trim)
	}

	def solve(input: String): String = {
		input.split("").filter(_.length!=0).filter(_=="1").length.toString()
	}
}