import java.util.Arrays; import java.util.Scanner; public class Slash_1883 { public static void log(Object obj) { System.out.println(obj.toString()); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int[] a = new int[3]; for(int i=0;i<3;i++) { a[i] = Integer.parseInt(String.valueOf(s.charAt(i))); } Arrays.sort(a); log(a[2]-a[0]); } }