import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		System.out.println(new Scanner(System.in).next().split("1",-1).length-1);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		System.out.println(new Scanner(System.in).next().split("1",-1).length-1);
	}
} Main public static void main(String[] args) {
		System.out.println(new Scanner(System.in).next().split("1",-1).length-1);
	} main {
		System.out.println(new Scanner(System.in).next().split("1",-1).length-1);
	} System.out.println(new Scanner(System.in).next().split("1",-1).length-1) System.out.println System.out System System.out new Scanner(System.in).next().split("1",-1).length-1 new Scanner(System.in).next().split("1",-1).length new Scanner(System.in).next().split("1",-1) new Scanner(System.in).next().split new Scanner(System.in).next() new Scanner(System.in).next new Scanner(System.in) "1" -1 1 new Scanner(System.in).next().split("1",-1).length 1 String[] args args public class Main {

	public static void main(String[] args) {
		System.out.println(new Scanner(System.in).next().split("1",-1).length-1);
	}
} public class Main {

	public static void main(String[] args) {
		System.out.println(new Scanner(System.in).next().split("1",-1).length-1);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		System.out.println(new Scanner(System.in).next().split("1",-1).length-1);
	}
}