'use strict';

function main(arg) {
    arg = arg.split(" ").sort((a,b)=>a-b);
    let ans = 0;
    
    for(let i=0; i<arg.length-1; i++) {
        ans = ans + (arg[i+1] - arg[i]);
    }
    
    console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));