import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	int a = stdIn.nextInt();
	int k=a;
	int count=0;
	for(int i=0;i<3;i++){
	    k=a%10;
	    if(k==1){
		count++;
	    }
	    a/=10;
	}
	System.out.println(count);
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	int a = stdIn.nextInt();
	int k=a;
	int count=0;
	for(int i=0;i<3;i++){
	    k=a%10;
	    if(k==1){
		count++;
	    }
	    a/=10;
	}
	System.out.println(count);
    }
} Main public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	int a = stdIn.nextInt();
	int k=a;
	int count=0;
	for(int i=0;i<3;i++){
	    k=a%10;
	    if(k==1){
		count++;
	    }
	    a/=10;
	}
	System.out.println(count);
    } main {
	Scanner stdIn = new Scanner(System.in);
	int a = stdIn.nextInt();
	int k=a;
	int count=0;
	for(int i=0;i<3;i++){
	    k=a%10;
	    if(k==1){
		count++;
	    }
	    a/=10;
	}
	System.out.println(count);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int a = stdIn.nextInt(); a stdIn.nextInt() stdIn.nextInt stdIn int k=a; k a int count=0; count 0 for(int i=0;i<3;i++){
	    k=a%10;
	    if(k==1){
		count++;
	    }
	    a/=10;
	} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
	    k=a%10;
	    if(k==1){
		count++;
	    }
	    a/=10;
	} {
	    k=a%10;
	    if(k==1){
		count++;
	    }
	    a/=10;
	} k=a%10 k a%10 a 10 if(k==1){
		count++;
	    } k==1 k 1 {
		count++;
	    } count++ count a/=10 a 10 System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	int a = stdIn.nextInt();
	int k=a;
	int count=0;
	for(int i=0;i<3;i++){
	    k=a%10;
	    if(k==1){
		count++;
	    }
	    a/=10;
	}
	System.out.println(count);
    }
}
