#include<stdio.h>
//#include<stdlib>
int main(){
    int s=0;
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);
    if(x>=y && x<=z || x<=y && x>=z) s=abs(x-y)+abs(x-z);
    else if(y>=x && y<=z || y<=x && y>=z) s=abs(x-y)+abs(y-z);
    else if (z>=y && z<=x || z>=x && z<=y) s=abs(z-y)+abs(z-x);
    printf("%d\n",s);
}