import java.util.*;

public class Main {
	public static void main(String[] args){
		//入力値を受け取る
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		//inputのなかで"1"に一致する数をカウント
		int count = 0;
		for(char x: input.toCharArray()){
			if(x == '1'){
				count++;
			}
		}
		System.out.println(count);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		//入力値を受け取る
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		//inputのなかで"1"に一致する数をカウント
		int count = 0;
		for(char x: input.toCharArray()){
			if(x == '1'){
				count++;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args){
		//入力値を受け取る
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		//inputのなかで"1"に一致する数をカウント
		int count = 0;
		for(char x: input.toCharArray()){
			if(x == '1'){
				count++;
			}
		}
		System.out.println(count);
	} main {
		//入力値を受け取る
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		//inputのなかで"1"に一致する数をカウント
		int count = 0;
		for(char x: input.toCharArray()){
			if(x == '1'){
				count++;
			}
		}
		System.out.println(count);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String input = scanner.nextLine(); input scanner.nextLine() scanner.nextLine scanner int count = 0; count 0 for(char x: input.toCharArray()){
			if(x == '1'){
				count++;
			}
		} char x input.toCharArray() input.toCharArray input {
			if(x == '1'){
				count++;
			}
		} {
			if(x == '1'){
				count++;
			}
		} if(x == '1'){
				count++;
			} x == '1' x '1' {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args){
		//入力値を受け取る
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		//inputのなかで"1"に一致する数をカウント
		int count = 0;
		for(char x: input.toCharArray()){
			if(x == '1'){
				count++;
			}
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args){
		//入力値を受け取る
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		//inputのなかで"1"に一致する数をカウント
		int count = 0;
		for(char x: input.toCharArray()){
			if(x == '1'){
				count++;
			}
		}
		System.out.println(count);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		//入力値を受け取る
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		//inputのなかで"1"に一致する数をカウント
		int count = 0;
		for(char x: input.toCharArray()){
			if(x == '1'){
				count++;
			}
		}
		System.out.println(count);
	}
}