// yukicoder: No.286 Modulo Discount Store // 2019.6.1 bal4u #include #if 1 #define gc() getchar_unlocked() #else #define gc() getchar() #endif int in() // 非負整数の入力 { int n = 0, c = gc(); do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0'); return n; } int m[16]; int dp[65600], dc[65600]; int main() { int i, j, k, N, lim, s, t; N = in(); for (i = 0; i < N; i++) m[i] = in(); lim = 1 << N; for (i = 0; i < lim; i++) { s = 0, k = i; for (j = 0; k; j++) if (k & (1< k) dp[t] = k; } } printf("%d\n", dp[lim-1]); return 0; }