#include <bits/stdc++.h>
using namespace std;

int main() {
  int a;
  cin >> a;
  int count = 0;
  int b;
  for(int i=0;i<a;i++){
  cin >> b;
    count += b;
  }
  if(a >= count){
  cout << a - count << endl;
  }
  else{
    cout << "-1" << endl;
}
}