#include <algorithm>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A[i] = a;
  }

  int sum = accumulate(A.begin(), A.end(), 0);

  int rest = N - sum;
  
  cout << ((rest > 0) ? rest : -1) << endl;
  return 0;
}
