"use strict"

function main(input) {
    let nums = input.split(' ')
    nums = nums.map(x => +x)
    nums.sort()//.reverse()
    let num = 0;
    for (let i=0; i<nums.length;i++) {
        let red = (i >= 1) ? nums[i - 1] : 0
        num += Math.abs(nums[i] - red)
    }
    num -= nums[0]
    console.log(num)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
