      PROGRAM tableTennisTraining
      IMPLICIT NONE
      integer(16) :: n,a,b
      integer(16) :: sub,ans,sma,big
      
      read*,n,a,b
      
      
      
      sub = abs( a-b )
      if( mod(sub,2)==0 )then
        ans = sub/2
      else
        sma = min(a,b)
        big = max(a,b)
        
        ans = (sma-1) + 1 + (big-1)/2
      endif
      
      
      
      print*,ans
      
      
      END PROGRAM