n = int(input()) A = list(map(int, input().split())) ans = 0 for t in range(1, 31): B = [a - t for a in A] tot = 0 cnt = 1 for b in B: if b == 0: ans += cnt cnt += 1 tot += b print(n * (n + 1) // 2 - ans + 1)