import java.util.Scanner;

public class Main {
	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int count = 0;
		
		if(a / 100 == 1) {
			count++;
			a -= 100;
		}
		
		
		if(a / 10 == 1) {
			count++;
			a -= 10;
		}
		
		if(a / 1 == 1) {
			count++;
		}
		System.out.println(count);

		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int count = 0;
		
		if(a / 100 == 1) {
			count++;
			a -= 100;
		}
		
		
		if(a / 10 == 1) {
			count++;
			a -= 10;
		}
		
		if(a / 1 == 1) {
			count++;
		}
		System.out.println(count);

		sc.close();
	}
} Main public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int count = 0;
		
		if(a / 100 == 1) {
			count++;
			a -= 100;
		}
		
		
		if(a / 10 == 1) {
			count++;
			a -= 10;
		}
		
		if(a / 1 == 1) {
			count++;
		}
		System.out.println(count);

		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int count = 0;
		
		if(a / 100 == 1) {
			count++;
			a -= 100;
		}
		
		
		if(a / 10 == 1) {
			count++;
			a -= 10;
		}
		
		if(a / 1 == 1) {
			count++;
		}
		System.out.println(count);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int count = 0; count 0 if(a / 100 == 1) {
			count++;
			a -= 100;
		} a / 100 == 1 a / 100 a 100 1 {
			count++;
			a -= 100;
		} count++ count a -= 100 a 100 if(a / 10 == 1) {
			count++;
			a -= 10;
		} a / 10 == 1 a / 10 a 10 1 {
			count++;
			a -= 10;
		} count++ count a -= 10 a 10 if(a / 1 == 1) {
			count++;
		} a / 1 == 1 a / 1 a 1 1 {
			count++;
		} count++ count System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String args[] args public class Main {
	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int count = 0;
		
		if(a / 100 == 1) {
			count++;
			a -= 100;
		}
		
		
		if(a / 10 == 1) {
			count++;
			a -= 10;
		}
		
		if(a / 1 == 1) {
			count++;
		}
		System.out.println(count);

		sc.close();
	}
} public class Main {
	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int count = 0;
		
		if(a / 100 == 1) {
			count++;
			a -= 100;
		}
		
		
		if(a / 10 == 1) {
			count++;
			a -= 10;
		}
		
		if(a / 1 == 1) {
			count++;
		}
		System.out.println(count);

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int count = 0;
		
		if(a / 100 == 1) {
			count++;
			a -= 100;
		}
		
		
		if(a / 10 == 1) {
			count++;
			a -= 10;
		}
		
		if(a / 1 == 1) {
			count++;
		}
		System.out.println(count);

		sc.close();
	}
}