import java.util.*;
class Main
{
		public static void main(String[] args) 
		{
			Scanner sc = new Scanner(System.in);
			
			String s = sc.next();
			
			int s1 = s.charAt(0);
			int s2 = s.charAt(1);
			int s3 = s.charAt(2);
			
			int sum = 0;
			
			if(s1!='0'){
				sum++;
			}
			
			if(s2!='0'){
				++sum;
			}
			
			if(s3!='0'){
				sum++;
			}
			System.out.println(sum);
		}
} import java.util.*; util.* java class Main
{
		public static void main(String[] args) 
		{
			Scanner sc = new Scanner(System.in);
			
			String s = sc.next();
			
			int s1 = s.charAt(0);
			int s2 = s.charAt(1);
			int s3 = s.charAt(2);
			
			int sum = 0;
			
			if(s1!='0'){
				sum++;
			}
			
			if(s2!='0'){
				++sum;
			}
			
			if(s3!='0'){
				sum++;
			}
			System.out.println(sum);
		}
} Main public static void main(String[] args) 
		{
			Scanner sc = new Scanner(System.in);
			
			String s = sc.next();
			
			int s1 = s.charAt(0);
			int s2 = s.charAt(1);
			int s3 = s.charAt(2);
			
			int sum = 0;
			
			if(s1!='0'){
				sum++;
			}
			
			if(s2!='0'){
				++sum;
			}
			
			if(s3!='0'){
				sum++;
			}
			System.out.println(sum);
		} main {
			Scanner sc = new Scanner(System.in);
			
			String s = sc.next();
			
			int s1 = s.charAt(0);
			int s2 = s.charAt(1);
			int s3 = s.charAt(2);
			
			int sum = 0;
			
			if(s1!='0'){
				sum++;
			}
			
			if(s2!='0'){
				++sum;
			}
			
			if(s3!='0'){
				sum++;
			}
			System.out.println(sum);
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int s1 = s.charAt(0); s1 s.charAt(0) s.charAt s 0 int s2 = s.charAt(1); s2 s.charAt(1) s.charAt s 1 int s3 = s.charAt(2); s3 s.charAt(2) s.charAt s 2 int sum = 0; sum 0 if(s1!='0'){
				sum++;
			} s1!='0' s1 '0' {
				sum++;
			} sum++ sum if(s2!='0'){
				++sum;
			} s2!='0' s2 '0' {
				++sum;
			} ++sum sum if(s3!='0'){
				sum++;
			} s3!='0' s3 '0' {
				sum++;
			} sum++ sum System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;
class Main
{
		public static void main(String[] args) 
		{
			Scanner sc = new Scanner(System.in);
			
			String s = sc.next();
			
			int s1 = s.charAt(0);
			int s2 = s.charAt(1);
			int s3 = s.charAt(2);
			
			int sum = 0;
			
			if(s1!='0'){
				sum++;
			}
			
			if(s2!='0'){
				++sum;
			}
			
			if(s3!='0'){
				sum++;
			}
			System.out.println(sum);
		}
}