import   scala.util.control.Breaks.{break, breakable}
object Main{
  def main(args: Array[String]){
      val sc = new java.util.Scanner(System.in)
      var x = sc.nextLong
      var y = sc.nextLong
      var z =0L
      var cnt = 0

      if ( y<x ) {
        x=x*(-1)
        cnt = cnt+1
      }
      breakable {
        while(x<y){
          x = x+1
          cnt = cnt+1
          z = x*(-1)
          if(z==y){
            cnt = cnt+1
            break
          }
        }
      }
      println(cnt)
    }
}