program probC
  implicit none
  integer i,j,a,b,c,tmp,min,max,mid,ans
  integer abc(3),par(3)

  read(*,*) a,b,c

  abc(1) = a
  abc(2) = b
  abc(3) = c

  call quicksort(abc,1,3)

  ans = 0
  do i=1,3
     par(i) = mod(abc(i),2)
  end do

  if(sum(par)==1)then
     ans = ans+1
     do i =1,3
        if ( par(i)==0 ) then
           abc(i)=abc(i)+1
        end if
     end do
  else if(sum(par)==2)then
     do i =1,3
        if ( par(i)==1) then
           abc(i)=abc(i)+1
        end if
     end do
  end if

  write (*,*)ans+ (2*abc(3)-abc(1)-abc(2))/2

     
    
end program probC


recursive subroutine quicksort(a, first, last)
  implicit none
  integer a(*)
  integer first, last
  integer i, j
  integer x, t

  x = a( (first+last) / 2 )
  i = first
  j = last
  do
     do while (a(i) < x)
        i=i+1
     end do
     do while (x < a(j))
        j=j-1
     end do
     if (i >= j) exit
     t = a(i);  a(i) = a(j);  a(j) = t
     i=i+1
     j=j-1
  end do
  if (first < i - 1) call quicksort(a, first, i - 1)
  if (j + 1 < last)  call quicksort(a, j + 1, last)
end subroutine quicksort
