import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	sc.close();
      	int n = 0;
      	for (int i=0; i<3; i++) {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        }
          System.out.println(n);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	sc.close();
      	int n = 0;
      	for (int i=0; i<3; i++) {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        }
          System.out.println(n);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	sc.close();
      	int n = 0;
      	for (int i=0; i<3; i++) {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        }
          System.out.println(n);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	sc.close();
      	int n = 0;
      	for (int i=0; i<3; i++) {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        }
          System.out.println(n);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc sc.close() sc.close sc int n = 0; n 0 for (int i=0; i<3; i++) {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        } {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        } if (s.substring(i,i+1).equals("1")) {
            n++;
          } s.substring(i,i+1).equals("1") s.substring(i,i+1).equals s.substring(i,i+1) s.substring s i i+1 i 1 "1" {
            n++;
          } n++ n System.out.println(n) System.out.println System.out System System.out n String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	sc.close();
      	int n = 0;
      	for (int i=0; i<3; i++) {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        }
          System.out.println(n);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	sc.close();
      	int n = 0;
      	for (int i=0; i<3; i++) {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        }
          System.out.println(n);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	sc.close();
      	int n = 0;
      	for (int i=0; i<3; i++) {
          if (s.substring(i,i+1).equals("1")) {
            n++;
          }
        }
          System.out.println(n);
	}
}