import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a, b, c, d, e, f, min, max; a = sc.nextDouble(); min = a; max = a; b = sc.nextDouble(); min = Math.min(min, b); max = Math.max(max, b); c = sc.nextDouble(); min = Math.min(min, c); max = Math.max(max, c); d = sc.nextDouble(); min = Math.min(min, d); max = Math.max(max, d); e = sc.nextDouble(); min = Math.min(min, e); max = Math.max(max, e); f = sc.nextDouble(); min = Math.min(min, f); max = Math.max(max, f); System.out.println((a + b + c + d + e + f - min - max) / 4); } }