#include <stdio.h>

int main(void){

  int S[100000];
  long count0=0;
  long count1=0;
  
  for(int i=0;;i++){
  	if(scanf("%d",S[i]=="\n"){
    	break;
    }
  }
  
  for(int i=0;S[i]!=NULL;i++){
  	if(S[i]==0)count1++;
    if(S[i]==1)count1++;
  }
  
  if(count1<=count0)printf("%d",count0);
  if(count1<=count0)printf("%d",count0);
  
}
