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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    int count0 = 0;
    int count1 = 0;
    for(int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if(x == 0) count0++;
        else if(x == 1) count1++;
    }
    if(count0 > count1) cout << 0;
    else cout << 1;
}
