import java.util.*;

class Main{
    public static  void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      int s1 = s /100;
      int s2 = (s - s1 * 100) /10;
      int s3 = s - s1 * 100 - s2 * 10;
      int n = 0;
      if (s1 == 1){
        n += 1;
      }
      if (s2 == 1){
        n += 1;
      }
      if (s3 == 1){
        n += 1;
      }

      System.out.println(n);





    }
} import java.util.*; util.* java class Main{
    public static  void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      int s1 = s /100;
      int s2 = (s - s1 * 100) /10;
      int s3 = s - s1 * 100 - s2 * 10;
      int n = 0;
      if (s1 == 1){
        n += 1;
      }
      if (s2 == 1){
        n += 1;
      }
      if (s3 == 1){
        n += 1;
      }

      System.out.println(n);





    }
} Main public static  void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      int s1 = s /100;
      int s2 = (s - s1 * 100) /10;
      int s3 = s - s1 * 100 - s2 * 10;
      int n = 0;
      if (s1 == 1){
        n += 1;
      }
      if (s2 == 1){
        n += 1;
      }
      if (s3 == 1){
        n += 1;
      }

      System.out.println(n);





    } main {
      Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      int s1 = s /100;
      int s2 = (s - s1 * 100) /10;
      int s3 = s - s1 * 100 - s2 * 10;
      int n = 0;
      if (s1 == 1){
        n += 1;
      }
      if (s2 == 1){
        n += 1;
      }
      if (s3 == 1){
        n += 1;
      }

      System.out.println(n);





    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int s1 = s /100; s1 s /100 s 100 int s2 = (s - s1 * 100) /10; s2 (s - s1 * 100) /10 (s - s1 * 100) s s1 * 100 s1 100 10 int s3 = s - s1 * 100 - s2 * 10; s3 s - s1 * 100 - s2 * 10 s - s1 * 100 - s2 * 10 s s1 * 100 s1 100 s2 * 10 s2 10 int n = 0; n 0 if (s1 == 1){
        n += 1;
      } s1 == 1 s1 1 {
        n += 1;
      } n += 1 n 1 if (s2 == 1){
        n += 1;
      } s2 == 1 s2 1 {
        n += 1;
      } n += 1 n 1 if (s3 == 1){
        n += 1;
      } s3 == 1 s3 1 {
        n += 1;
      } n += 1 n 1 System.out.println(n) System.out.println System.out System System.out n String args[] args
import java.util.*;

class Main{
    public static  void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      int s1 = s /100;
      int s2 = (s - s1 * 100) /10;
      int s3 = s - s1 * 100 - s2 * 10;
      int n = 0;
      if (s1 == 1){
        n += 1;
      }
      if (s2 == 1){
        n += 1;
      }
      if (s3 == 1){
        n += 1;
      }

      System.out.println(n);





    }
}
