/*----<Bồ tác phù hộ code không bị bug>--------
_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \| |// '.
/ \||| : |||// \
/ _||||| -:- |||||- \
| | \ - /// | |
| \_| ''\---/'' |_/ |
\ .-\__ '-' ___/-. /
___'. .' /--.--\ `. .'___
."" '< `.___\_<|>_/___.' >' "".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `_. \_ __\ /__ _/ .-` / /
=====`-.____`.___ \_____/___.-`___.-'=====
`=---='
------------------<>-------------------------*/
#include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fr(x, l, r) for (int x = l; x < r; x++)
#define frr(x, l, r) for (int x = l; x <= r; x++)
#define fd(x, l, r) for (int x = l; x >= r; x--)
#define cs const
#define TIME (1.0*clock() / CLOCKS_PER_SEC)
#define RUNTIME cerr << "\n" << "Runtime: " << TIME << "s\n";
#define Fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
typedef double db;
typedef std::string str;
typedef std::vector<int> vi;
typedef std::greater<int> gi;
typedef std::map<int, int> mii;
typedef std::pair<int, int> ii;
cs int N = 1e6 + 5;
cs int oo = 1e18;
using namespace std;
signed main(){
Fastio;
int n; cin >> n;
int a[n];
int chan = 0, le = 0;
fr(i,0,n){
cin >> a[i];
if (a[i] % 2 == 0) ++chan;
else ++le;
}
int sum = chan * (chan - 1)/2;
int tong = le * (le - 1)/2;
cout << sum + tong;
RUNTIME;
return 0;
}
LyotLS0tPELhu5MgdMOhYyBwaMO5IGjhu5kgY29kZSBraMO0bmcgYuG7iyBidWc+LS0tLS0tLS0KICAgICAgICAgICAgICAgX29vMG9vXyAKICAgICAgICAgICAgICBvODg4ODg4OG8gCiAgICAgICAgICAgICAgODgiIC4gIjg4IAogICAgICAgICAgICAgICh8IC1fLSB8KSAKICAgICAgICAgICAgICAwXCAgPSAgLzAgCiAgICAgICAgICAgIF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