# Uses python3
import sys


def get_majority_element(a, left, right):
    if left == right:
        return -1
    if left + 1 == right:
        return a[left]
    #write your code here
    return -1

if __name__ == '__main__':
    input = sys.stdin.read()
    n, *a = list(map(int, input.split()))
    c={}
    for i in a:
        c[i]=c.get(i,0)+1
    bigc = None
    for word in c:
        value = c[word]
        if bigc is None or value > bigc:
            bigc = value
    if bigc>(n//2):
        print(1)
    else:
        print(0)

    #if get_majority_element(a, 0, n) != -1:
    #    print(1)
    #else:
        #print(0)
