package no027; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] v = new int[4]; int[] a = new int[3]; for(int i=0;i<4;i++) { v[i] = sc.nextInt(); } int ans = 1000000; for(a[0]=1;a[0]<=30;a[0]++) { for(a[1]=a[0]+1;a[1]<=30;a[1]++) { for(a[2]=a[1]+1;a[2]<=30;a[2]++) { int sum = 0; for(int i=0;i<4;i++) { int[] dp = new int[v[i]+1]; Arrays.fill(dp, 10000); dp[0] = 0; for(int j=0;j