#include<stdio.h>
 
int main (){
  int x[5];
  int x_length = sizeof x / sizeof x[0];
  for(int i = 0;i < x_length;i++){
    scanf("%d",&x[i]);
  }
 
  for(int i = 0;i < x_length;i++){
    if(x[i] == 0){
      printf("%d",i+1);
    }
  }
  return 0;
}