#include <iostream>
#include <vector>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, res = 1, num, cnt = 0;
	cin >> n;
	vector<int> nums;
	for (int i = 0; i < n; i++)
	{
		cin >> num;
		num %= 2;//0-even, 1 -odd
		nums.push_back(num);
	}
	for (int i = 0; i < n; i++)
	{
		res = nums[i];
		for (int j = i; j < n; j++)
		{
			res *= nums[j];
			if (res == 0)
			{
				cnt += n - j;
				break;
			}
		}
	}
	cout << cnt;
	return 0;
}