#!/usr/bin/env python3 def minimize_cost(a, b, c): cost = min(b - a, b - c, abs(c - a)) return cost def main(): a, b, c = (int(z) for z in input().split()) cost = minimize_cost(a, b, c) print(cost) if __name__ == "__main__": main()