import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int s = 1;
		for(int i = 0; i < 5; i++){
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		}
		System.out.println(s);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int s = 1;
		for(int i = 0; i < 5; i++){
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		}
		System.out.println(s);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int s = 1;
		for(int i = 0; i < 5; i++){
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		}
		System.out.println(s);
	} main {
		Scanner sc = new Scanner(System.in);
		int s = 1;
		for(int i = 0; i < 5; i++){
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		}
		System.out.println(s);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = 1; s 1 for(int i = 0; i < 5; i++){
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		} {
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		} if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			} sc.nextInt() != 0 sc.nextInt() sc.nextInt sc 0 {
				s++;
			} s++ s {
				i += 5;
			} i += 5 i 5 System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int s = 1;
		for(int i = 0; i < 5; i++){
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		}
		System.out.println(s);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int s = 1;
		for(int i = 0; i < 5; i++){
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		}
		System.out.println(s);
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int s = 1;
		for(int i = 0; i < 5; i++){
			if(sc.nextInt() != 0){
				s++;
			}else{
				i += 5;
			}
		}
		System.out.println(s);
	}
}