import java.util.*; public class Main { static int[] prices; static int[] dp; static int n; public static void main (String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); prices = new int[n]; for (int i = 0; i < n; i++) { prices[i] = sc.nextInt(); } dp = new int[1 << n]; Arrays.fill(dp, -1); dp[0] = 0; System.out.println(dfw((1 << n) - 1)); } static int dfw(int mask) { if (dp[mask] >= 0) { return dp[mask]; } dp[mask] = Integer.MAX_VALUE; int total = 0; for (int i = 0; i < n; i++) { if ((mask & (1 <