#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4200000;
int dp[MAXN], dp2[MAXN], a[25], to[25][25];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  memset(to, -1, sizeof(to));
  for (int i = 1; i < n; i++) {
    int ok = 0;
    for (int j = 0; j < i; j++) {
      for (int k = 0; k < i; k++) {
        if (a[j] + a[k] == a[i]) {
          ok = 1;
          to[i][j] = k;
        }
      }
    }
    if (ok == 0) {
      printf("-1\n");
      return 0;
    }
  }
  dp[1 << 0] = 1;
  int mx = 1 << (n - 1);
  int ans = MAXN;
  for (int i = 1; i < n; i++) {
    memset(dp2, 0, sizeof(dp2));
    for (int j = 1; j < mx; j++) {
      if (dp[j] == 0) continue;
      int L = 0, ok = 0;
      for (int k = 0; k < i; k++) {
        if ((1 << k) & j) {
          L++;
          if (to[i][k] != -1 && ((1 << to[i][k]) & j)) ok = 1;
        }
      }
      if (ok == 0) continue;
      if (i == n - 1) {
        ans = min(ans, L);
        continue;
      }
      for (int k = 0; k < i; k++)
        if ((1 << k) & j) {
          int res = j ^ (1 << k);
          res |= (1 << i);
          dp2[res] = 1;
        }
      dp2[j | (1 << i)] = 1;
    }
    for (int j = 1; j < mx; j++) dp[j] = dp2[j];
  }
  if (ans == MAXN)
    printf("-1\n");
  else
    printf("%d\n", ans);
  return 0;
}
