import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] x = new int[5];
		
		StringBuilder sb = new StringBuilder();
		
		for(int i=0; i<5; i++) {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		}
		
		System.out.println(sb);
		
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] x = new int[5];
		
		StringBuilder sb = new StringBuilder();
		
		for(int i=0; i<5; i++) {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		}
		
		System.out.println(sb);
		
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] x = new int[5];
		
		StringBuilder sb = new StringBuilder();
		
		for(int i=0; i<5; i++) {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		}
		
		System.out.println(sb);
		
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] x = new int[5];
		
		StringBuilder sb = new StringBuilder();
		
		for(int i=0; i<5; i++) {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		}
		
		System.out.println(sb);
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int[] x = new int[5]; x new int[5] 5 StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0; i<5; i++) {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		} {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		} x[i] = Integer.parseInt(st.nextToken()) x[i] x i Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st if(x[i] == 0)
				sb.append(i+1 + "\n"); x[i] == 0 x[i] x i 0 sb.append(i+1 + "\n") sb.append sb i+1 + "\n" i+1 + "\n" i 1 "\n" System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] x = new int[5];
		
		StringBuilder sb = new StringBuilder();
		
		for(int i=0; i<5; i++) {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		}
		
		System.out.println(sb);
		
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] x = new int[5];
		
		StringBuilder sb = new StringBuilder();
		
		for(int i=0; i<5; i++) {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		}
		
		System.out.println(sb);
		
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] x = new int[5];
		
		StringBuilder sb = new StringBuilder();
		
		for(int i=0; i<5; i++) {
			x[i] = Integer.parseInt(st.nextToken());
			
			if(x[i] == 0)
				sb.append(i+1 + "\n");
		}
		
		System.out.println(sb);
		
	}

}