#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5;
int n, a[N + 5];
ll s[N + 5];
int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    if (fopen("BEAUTY.INP", "r")) {
        freopen("BEAUTY.INP", "r", stdin);
        freopen("BEAUTY.OUT", "w", stdout);
    }
    cin >> n;
    s[0] = 0;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        s[i] = s[i - 1] + a[i];
    }
    int l = 1, r = n;
    ll res = -1;
    while(l < r){
        ll x = s[l];
        ll y = s[n] - s[r - 1];
        if(x == y){
            res = l;
        }
        l++;
        r--;
    }
    cout << res;
    return 0;
}
