import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int a = Integer.parseInt(sa[0]); int b = Integer.parseInt(sa[1]); int c = Integer.parseInt(sa[2]); br.close(); if (a <= b && b <= c || c <= b && b <= a) { System.out.println(0); return; } if (a <= b) { System.out.println(Math.min(b - a, b - c)); } else { System.out.println(Math.min(a - b, c - b)); } } }