"use strict"

function main(input) {
    let nums = input.split(' ')
    nums = nums.map(x => +x)//reduce( (x, y) => x - y , 0 )
    nums.sort().reverse()
    //let fst = nums.shift()
    //nums.unshift(0)

    // 0 + (3 - 6 ) + (1 - 3) 
    // 0 3(-6 = 3) 1() 
    // 6 + 3 + 1 - ( 3 + 2 ) = 9 - 6
    let num = 0;
    //let num = nums.reduce((prev, curr) => (curr - prev ),0) //+ nums[0]
    for (let i=0; i<nums.length;i++) {
        let red = (i >= 1) ? nums[i - 1] : 0
        num += Math.abs(nums[i] - red)

        //console.log(num, nums[i], red)
    }
    num -= nums[0]
    console.log(num)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
