import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {
		new Main().run();
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		int v=sc.nextInt();
		int ans=0;
		while(v>0) {
			if(v%10==1)++ans;
			v/=10;
		}
		System.out.println(ans);
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
	
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) throws Exception {
		new Main().run();
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		int v=sc.nextInt();
		int ans=0;
		while(v>0) {
			if(v%10==1)++ans;
			v/=10;
		}
		System.out.println(ans);
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
	
} Main public static void main(String[] args) throws Exception {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args void run() {
		Scanner sc=new Scanner(System.in);
		int v=sc.nextInt();
		int ans=0;
		while(v>0) {
			if(v%10==1)++ans;
			v/=10;
		}
		System.out.println(ans);
	} run {
		Scanner sc=new Scanner(System.in);
		int v=sc.nextInt();
		int ans=0;
		while(v>0) {
			if(v%10==1)++ans;
			v/=10;
		}
		System.out.println(ans);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int v=sc.nextInt(); v sc.nextInt() sc.nextInt sc int ans=0; ans 0 while(v>0) {
			if(v%10==1)++ans;
			v/=10;
		} v>0 v 0 {
			if(v%10==1)++ans;
			v/=10;
		} if(v%10==1)++ans; v%10==1 v%10 v 10 1 ++ans ans v/=10 v 10 System.out.println(ans) System.out.println System.out System System.out ans static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	} tr {
		System.out.println(Arrays.deepToString(objects));
	} System.out.println(Arrays.deepToString(objects)) System.out.println System.out System System.out Arrays.deepToString(objects) Arrays.deepToString Arrays objects Object... objects objects
import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {
		new Main().run();
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		int v=sc.nextInt();
		int ans=0;
		while(v>0) {
			if(v%10==1)++ans;
			v/=10;
		}
		System.out.println(ans);
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
	
}
