from collections import Counter def solve(n, a): C = Counter() ans = 0 for v in a: for i in range(1, v + 1): if i * i > v: break if v % i == 0: if v // i != i: C[v // i] += 1 C[i] += 1 else: C[v // i] += 1 for v, c in C.items(): if c >= (n + 1) // 2 + 1: ans = max(ans, v) return ans n = int(input()) a = list(map(int,input().split())) print(solve(n, a))