a, b, c = map(int, list(input())) print(max(a, b, c) - min(a, b, c))