import java.util.*;
public class Main {
	public static void main(String[] args){
		//データ取り込み
		Scanner sc = new Scanner(System.in);
		//String S = sc.next();
		//int N = sc.nextInt();
		//System.out.println();
		String S = sc.next();
		int cnt = 0;
		
		for(char a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		//データ取り込み
		Scanner sc = new Scanner(System.in);
		//String S = sc.next();
		//int N = sc.nextInt();
		//System.out.println();
		String S = sc.next();
		int cnt = 0;
		
		for(char a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main public static void main(String[] args){
		//データ取り込み
		Scanner sc = new Scanner(System.in);
		//String S = sc.next();
		//int N = sc.nextInt();
		//System.out.println();
		String S = sc.next();
		int cnt = 0;
		
		for(char a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		}
		System.out.println(cnt);
	} main {
		//データ取り込み
		Scanner sc = new Scanner(System.in);
		//String S = sc.next();
		//int N = sc.nextInt();
		//System.out.println();
		String S = sc.next();
		int cnt = 0;
		
		for(char a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		}
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int cnt = 0; cnt 0 for(char a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		} char a S.toCharArray() S.toCharArray S {
			if(a == '1'){
				cnt++;
			}
		} {
			if(a == '1'){
				cnt++;
			}
		} if(a == '1'){
				cnt++;
			} a == '1' a '1' {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
	public static void main(String[] args){
		//データ取り込み
		Scanner sc = new Scanner(System.in);
		//String S = sc.next();
		//int N = sc.nextInt();
		//System.out.println();
		String S = sc.next();
		int cnt = 0;
		
		for(char a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} public class Main {
	public static void main(String[] args){
		//データ取り込み
		Scanner sc = new Scanner(System.in);
		//String S = sc.next();
		//int N = sc.nextInt();
		//System.out.println();
		String S = sc.next();
		int cnt = 0;
		
		for(char a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		//データ取り込み
		Scanner sc = new Scanner(System.in);
		//String S = sc.next();
		//int N = sc.nextInt();
		//System.out.println();
		String S = sc.next();
		int cnt = 0;
		
		for(char a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}