<?php // Your code here! $word = trim(fgets(STDIN)); $ans = 0; for($i = 0; $i < strlen($word); $i++) { $ans += intval($word[$i]); } echo $ans; ?>