#include <bits/stdc++.h>
using namespace std;
vector<long long> A, AO, P, PE, PO;
vector<vector<int>> E;
void dfs(int u, int p)
{
for (int v: E[u]) {
if (v == p) {
continue;
}
dfs(v, u);
A[u] += A[v];
AO[u] += AO[v];
A[u] += P[v] + PE[v] + PO[v] + 1;
AO[u] += PE[v] + 1;
A[u] += P[u] * (PE[v] + PO[v] + 1) + (P[v] + PE[v] + PO[v] + 1) * (PE[u] + PO[u]);
AO[u] += PO[u] * PO[v] + PE[u] * (PE[v] + 1);
P[u] += P[v] + PE[v] + PO[v] + 1;
PE[u] += PO[v];
PO[u] += PE[v] + 1;
}
}
int main()
{
int n;
cin >> n;
E.assign(1 + n, vector<int>());
for (int i = 1; i < n; ++i) {
int u, v;
cin >> u >> v;
E[u].push_back(v);
E[v].push_back(u);
}
A.assign(1 + n, 0);
AO.assign(1 + n, 0);
P.assign(1 + n, 0);
PE.assign(1 + n, 0);
PO.assign(1 + n, 0);
dfs(1, -1);
cout << (A[1] - AO[1]) / 2 + AO[1] << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp2ZWN0b3I8bG9uZyBsb25nPiBBLCBBTywgUCwgUEUsIFBPOwp2ZWN0b3I8dmVjdG9yPGludD4+IEU7Cgp2b2lkIGRmcyhpbnQgdSwgaW50IHApCnsKICAgIGZvciAoaW50IHY6IEVbdV0pIHsKICAgICAgICBpZiAodiA9PSBwKSB7CiAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgIH0KCiAgICAgICAgZGZzKHYsIHUpOwoKICAgICAgICBBW3VdICs9IEFbdl07CiAgICAgICAgQU9bdV0gKz0gQU9bdl07CgogICAgICAgIEFbdV0gKz0gUFt2XSArIFBFW3ZdICsgUE9bdl0gKyAxOwogICAgICAgIEFPW3VdICs9IFBFW3ZdICsgMTsKCiAgICAgICAgQVt1XSArPSBQW3VdICogKFBFW3ZdICsgUE9bdl0gKyAxKSArIChQW3ZdICsgUEVbdl0gKyBQT1t2XSArIDEpICogKFBFW3VdICsgUE9bdV0pOwogICAgICAgIEFPW3VdICs9IFBPW3VdICogUE9bdl0gKyBQRVt1XSAqIChQRVt2XSArIDEpOwoKICAgICAgICBQW3VdICs9IFBbdl0gKyBQRVt2XSArIFBPW3ZdICsgMTsKICAgICAgICBQRVt1XSArPSBQT1t2XTsKICAgICAgICBQT1t1XSArPSBQRVt2XSArIDE7CiAgICB9Cn0KCmludCBtYWluKCkKewogICAgaW50IG47CiAgICBjaW4gPj4gbjsKICAgIEUuYXNzaWduKDEgKyBuLCB2ZWN0b3I8aW50PigpKTsKICAgIGZvciAoaW50IGkgPSAxOyBpIDwgbjsgKytpKSB7CiAgICAgICAgaW50IHUsIHY7CiAgICAgICAgY2luID4+IHUgPj4gdjsKICAgICAgICBFW3VdLnB1c2hfYmFjayh2KTsKICAgICAgICBFW3ZdLnB1c2hfYmFjayh1KTsKICAgIH0KICAgIEEuYXNzaWduKDEgKyBuLCAwKTsKICAgIEFPLmFzc2lnbigxICsgbiwgMCk7CiAgICBQLmFzc2lnbigxICsgbiwgMCk7CiAgICBQRS5hc3NpZ24oMSArIG4sIDApOwogICAgUE8uYXNzaWduKDEgKyBuLCAwKTsKICAgIGRmcygxLCAtMSk7CiAgICBjb3V0IDw8IChBWzFdIC0gQU9bMV0pIC8gMiArIEFPWzFdIDw8IGVuZGw7CiAgICByZXR1cm4gMDsKfQ==