import java.util.Scanner;
public class Main{
  // TODO 自動生成されたメソッド・スタブ
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main{
  // TODO 自動生成されたメソッド・スタブ
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    }
} Main // TODO 自動生成されたメソッド・スタブ
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    } main {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int i = scan.nextInt(); i scan.nextInt() scan.nextInt scan String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i String[] ss = s.split(""); ss s.split("") s.split s "" int count = 0; count 0 for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    } String masu ss {
      if(masu.equals("1")) {
        count = count + 1;
      }
    } {
      if(masu.equals("1")) {
        count = count + 1;
      }
    } if(masu.equals("1")) {
        count = count + 1;
      } masu.equals("1") masu.equals masu "1" {
        count = count + 1;
      } count = count + 1 count count + 1 count 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
  // TODO 自動生成されたメソッド・スタブ
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    }
} public class Main{
  // TODO 自動生成されたメソッド・スタブ
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    }
} Main
import java.util.Scanner;
public class Main{
  // TODO 自動生成されたメソッド・スタブ
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    }
}