import sys
from collections import Counter

sys.stdin = open('versus.in')
sys.stdout = open('versus.out', 'w')

n = input()
a = map(int, input().split())

count = Counter()

for i in a:
	count[i % 2] += 1

print(count[0] * count[1])	
