import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.next();
    final boolean firstPlace = placesString.charAt(0) == '1';
    final boolean secondPlace = placesString.charAt(1) == '1';
    final boolean thirdPlace = placesString.charAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
}
class Places {
  public final boolean firstPlace;
  public final boolean secondPlace;
  public final boolean thirdPlace;
  public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  }
}
class MarbleCounter {
  public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.next();
    final boolean firstPlace = placesString.charAt(0) == '1';
    final boolean secondPlace = placesString.charAt(1) == '1';
    final boolean thirdPlace = placesString.charAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
} Main public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  } main {
    final Main application = new Main();
    application.run();
  } final Main application = new Main(); application new Main() application.run() application.run application String[] args args public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  } run {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  } final Places places = this.scanFromStdin(); places this.scanFromStdin() this.scanFromStdin this final int marbleCount = new MarbleCounter().count(places); marbleCount new MarbleCounter().count(places) new MarbleCounter().count new MarbleCounter() places printMarbleCount(marbleCount) printMarbleCount marbleCount Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.next();
    final boolean firstPlace = placesString.charAt(0) == '1';
    final boolean secondPlace = placesString.charAt(1) == '1';
    final boolean thirdPlace = placesString.charAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  } scanFromStdin {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.next();
    final boolean firstPlace = placesString.charAt(0) == '1';
    final boolean secondPlace = placesString.charAt(1) == '1';
    final boolean thirdPlace = placesString.charAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final String placesString = scanner.next(); placesString scanner.next() scanner.next scanner final boolean firstPlace = placesString.charAt(0) == '1'; firstPlace placesString.charAt(0) == '1' placesString.charAt(0) placesString.charAt placesString 0 '1' final boolean secondPlace = placesString.charAt(1) == '1'; secondPlace placesString.charAt(1) == '1' placesString.charAt(1) placesString.charAt placesString 1 '1' final boolean thirdPlace = placesString.charAt(2) == '1'; thirdPlace placesString.charAt(2) == '1' placesString.charAt(2) placesString.charAt placesString 2 '1' return new Places(firstPlace, secondPlace, thirdPlace); new Places(firstPlace, secondPlace, thirdPlace) void printMarbleCount(int count) {
    System.out.println(count);
  } printMarbleCount {
    System.out.println(count);
  } System.out.println(count) System.out.println System.out System System.out count int count count class Places {
  public final boolean firstPlace;
  public final boolean secondPlace;
  public final boolean thirdPlace;
  public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  }
} Places public final boolean firstPlace; firstPlace public final boolean secondPlace; secondPlace public final boolean thirdPlace; thirdPlace public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  } Places {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  } this.firstPlace = firstPlace this.firstPlace this this.firstPlace firstPlace this.secondPlace = secondPlace this.secondPlace this this.secondPlace secondPlace this.thirdPlace = thirdPlace this.thirdPlace this this.thirdPlace thirdPlace boolean firstPlace firstPlace boolean secondPlace secondPlace boolean thirdPlace thirdPlace class MarbleCounter {
  public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  }
} MarbleCounter public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  } count {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  } int count = 0; count 0 if (places.firstPlace) {
      count++;
    } places.firstPlace places places.firstPlace {
      count++;
    } count++ count if (places.secondPlace) {
      count++;
    } places.secondPlace places places.secondPlace {
      count++;
    } count++ count if (places.thirdPlace) {
       count++;
    } places.thirdPlace places places.thirdPlace {
       count++;
    } count++ count return count; count Places places places public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.next();
    final boolean firstPlace = placesString.charAt(0) == '1';
    final boolean secondPlace = placesString.charAt(1) == '1';
    final boolean thirdPlace = placesString.charAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
} public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.next();
    final boolean firstPlace = placesString.charAt(0) == '1';
    final boolean secondPlace = placesString.charAt(1) == '1';
    final boolean thirdPlace = placesString.charAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.next();
    final boolean firstPlace = placesString.charAt(0) == '1';
    final boolean secondPlace = placesString.charAt(1) == '1';
    final boolean thirdPlace = placesString.charAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
}
class Places {
  public final boolean firstPlace;
  public final boolean secondPlace;
  public final boolean thirdPlace;
  public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  }
}
class MarbleCounter {
  public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  }
}
