import java.util.*;

public class Main{
  public static void main(String[] args){
    /*
    int a = 101;
    */
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = 0;
    int[] s;
    s = new int[3];
    s[0] = a / 100;
    s[1] = (a % 100) / 10;
    s[2] = a % 10;
    for(int i = 0; i < 3; i++){
      if(s[i] == 1){
        b++;
      }
    }
    System.out.println(b);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    /*
    int a = 101;
    */
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = 0;
    int[] s;
    s = new int[3];
    s[0] = a / 100;
    s[1] = (a % 100) / 10;
    s[2] = a % 10;
    for(int i = 0; i < 3; i++){
      if(s[i] == 1){
        b++;
      }
    }
    System.out.println(b);
  }
} Main public static void main(String[] args){
    /*
    int a = 101;
    */
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = 0;
    int[] s;
    s = new int[3];
    s[0] = a / 100;
    s[1] = (a % 100) / 10;
    s[2] = a % 10;
    for(int i = 0; i < 3; i++){
      if(s[i] == 1){
        b++;
      }
    }
    System.out.println(b);
  } main {
    /*
    int a = 101;
    */
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = 0;
    int[] s;
    s = new int[3];
    s[0] = a / 100;
    s[1] = (a % 100) / 10;
    s[2] = a % 10;
    for(int i = 0; i < 3; i++){
      if(s[i] == 1){
        b++;
      }
    }
    System.out.println(b);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = 0; b 0 int[] s; s s = new int[3] s new int[3] 3 s[0] = a / 100 s[0] s 0 a / 100 a 100 s[1] = (a % 100) / 10 s[1] s 1 (a % 100) / 10 (a % 100) a 100 10 s[2] = a % 10 s[2] s 2 a % 10 a 10 for(int i = 0; i < 3; i++){
      if(s[i] == 1){
        b++;
      }
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      if(s[i] == 1){
        b++;
      }
    } {
      if(s[i] == 1){
        b++;
      }
    } if(s[i] == 1){
        b++;
      } s[i] == 1 s[i] s i 1 {
        b++;
      } b++ b System.out.println(b) System.out.println System.out System System.out b String[] args args public class Main{
  public static void main(String[] args){
    /*
    int a = 101;
    */
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = 0;
    int[] s;
    s = new int[3];
    s[0] = a / 100;
    s[1] = (a % 100) / 10;
    s[2] = a % 10;
    for(int i = 0; i < 3; i++){
      if(s[i] == 1){
        b++;
      }
    }
    System.out.println(b);
  }
} public class Main{
  public static void main(String[] args){
    /*
    int a = 101;
    */
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = 0;
    int[] s;
    s = new int[3];
    s[0] = a / 100;
    s[1] = (a % 100) / 10;
    s[2] = a % 10;
    for(int i = 0; i < 3; i++){
      if(s[i] == 1){
        b++;
      }
    }
    System.out.println(b);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    /*
    int a = 101;
    */
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = 0;
    int[] s;
    s = new int[3];
    s[0] = a / 100;
    s[1] = (a % 100) / 10;
    s[2] = a % 10;
    for(int i = 0; i < 3; i++){
      if(s[i] == 1){
        b++;
      }
    }
    System.out.println(b);
  }
}
