import java.util.*;

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        int g=0;
        if(n.substring(0,1).equals("1")) {
            g++;
        }
        if(n.substring(1,2).equals("1")) {
            g++;
        }
        if(n.substring(2,3).equals("1")) {
            g++;
        } 
        System.out.println(g);
    }
}
