import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    
    int cnt = 0;
    
    for(int i=0;i<str.length();i++) {
      if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      }
    }
    System.out.println(cnt);
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    
    int cnt = 0;
    
    for(int i=0;i<str.length();i++) {
      if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      }
    }
    System.out.println(cnt);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    
    int cnt = 0;
    
    for(int i=0;i<str.length();i++) {
      if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      }
    }
    System.out.println(cnt);
  } main {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    
    int cnt = 0;
    
    for(int i=0;i<str.length();i++) {
      if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      }
    }
    System.out.println(cnt);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc int cnt = 0; cnt 0 for(int i=0;i<str.length();i++) {
      if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      }
    } int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
      if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      }
    } {
      if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      }
    } if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      } str.substring(i, i+1).equals("1") str.substring(i, i+1).equals str.substring(i, i+1) str.substring str i i+1 i 1 "1" {
        cnt += 1;
      } cnt += 1 cnt 1 System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    
    int cnt = 0;
    
    for(int i=0;i<str.length();i++) {
      if(str.substring(i, i+1).equals("1")) {
        cnt += 1;
      }
    }
    System.out.println(cnt);
  }
}