import java.util.Scanner; import java.util.Arrays; import java.util.List; public class No289 { public static void main(String[] args) { int count=0; Scanner in = new Scanner(System.in); String str = in.next(); List list = Arrays.asList(str.split("")); for(String q :list){ count += toInt(q); } in.close(); System.out.println(count); } public static int toInt(String str){ int ans = 0; try{ ans = Integer.parseInt(str); } catch(Exception ex){ } return ans; } }