import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] s = new int[6]; for(int i = 0 ; i < 6 ; i++) s[i] = sc.nextInt(); Arrays.sort(s); int ans = s[1] + s[2] + s[3] + s[4]; System.out.println(ans); } }