'use strict'

const main = (input) => {
    let tasks = input.split('\n')[0].split(' ').map(i => parseInt(i))
    tasks = tasks.sort((a, b) => a - b)
    let total = 0
    for(let i = 1; i < tasks.length; i++) {
        total += tasks[i] - tasks[i - 1]
    }
    console.log(total)
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))