import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines n=int(readline()) m=list(map(int, read().split())) s=[sum(x for j, x in enumerate(m) if i&(1<x: dp[i^(1<