import java.util.*;

public class Balls { public int calcDistance(int A, int B, int C, int D) { return ((A+B+C+D)<<2) -(A+B+C+D); } }