import java.util.Scanner;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int[] a = new int[3];
    int count = 0;
    for(int i=0;i<3;i++){
      a[i] = Integer.valueOf(str.substring(i,i+1));
    }
    for(int j : a){
      if(j == 1) count++;
    }
    System.out.print(count);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int[] a = new int[3];
    int count = 0;
    for(int i=0;i<3;i++){
      a[i] = Integer.valueOf(str.substring(i,i+1));
    }
    for(int j : a){
      if(j == 1) count++;
    }
    System.out.print(count);
  }
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int[] a = new int[3];
    int count = 0;
    for(int i=0;i<3;i++){
      a[i] = Integer.valueOf(str.substring(i,i+1));
    }
    for(int j : a){
      if(j == 1) count++;
    }
    System.out.print(count);
  } main {
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int[] a = new int[3];
    int count = 0;
    for(int i=0;i<3;i++){
      a[i] = Integer.valueOf(str.substring(i,i+1));
    }
    for(int j : a){
      if(j == 1) count++;
    }
    System.out.print(count);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc int[] a = new int[3]; a new int[3] 3 int count = 0; count 0 for(int i=0;i<3;i++){
      a[i] = Integer.valueOf(str.substring(i,i+1));
    } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
      a[i] = Integer.valueOf(str.substring(i,i+1));
    } {
      a[i] = Integer.valueOf(str.substring(i,i+1));
    } a[i] = Integer.valueOf(str.substring(i,i+1)) a[i] a i Integer.valueOf(str.substring(i,i+1)) Integer.valueOf Integer str.substring(i,i+1) str.substring str i i+1 i 1 for(int j : a){
      if(j == 1) count++;
    } int j a {
      if(j == 1) count++;
    } {
      if(j == 1) count++;
    } if(j == 1) count++; j == 1 j 1 count++ count System.out.print(count) System.out.print System.out System System.out count String args[] args
import java.util.Scanner;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int[] a = new int[3];
    int count = 0;
    for(int i=0;i<3;i++){
      a[i] = Integer.valueOf(str.substring(i,i+1));
    }
    for(int j : a){
      if(j == 1) count++;
    }
    System.out.print(count);
  }
}