object Main extends App{
  override def main(args:Array[String])={
    var nums = readLine.split(" ").map(a => a.toInt)
    nums = nums.sorted
    var res = 0
    for(i <- 1 until nums.length){
      res += nums(i)-nums(i-1)
    }
    println(res)
  }
}