#include <bits/stdc++.h>
void sc(int &x) { scanf("%d", &x); }
void sc(int &x, int &y) { scanf("%d%d", &x, &y); }
void sc(int &x, int &y, int &z) { scanf("%d%d%d", &x, &y, &z); }
void sc(long long &x) { scanf("%lld", &x); }
void sc(long long &x, long long &y) { scanf("%lld%lld", &x, &y); }
void sc(long long &x, long long &y, long long &z) {
  scanf("%lld%lld%lld", &x, &y, &z);
}
void sc(char *x) { scanf("%s", x); }
void sc(char *x, char *y) { scanf("%s%s", x, y); }
void sc(char *x, char *y, char *z) { scanf("%s%s%s", x, y, z); }
void out(int x) { printf("%d\n", x); }
void out(long long x) { printf("%lld\n", x); }
void out(int x, int y) { printf("%d %d\n", x, y); }
void out(long long x, long long y) { printf("%lld %lld\n", x, y); }
void out(int x, int y, int z) { printf("%d %d %d\n", x, y, z); }
void out(long long x, long long y, long long z) {
  printf("%lld %lld %lld\n", x, y, z);
}
void ast(long long x, long long l, long long r) { assert(x >= l && x <= r); }
using namespace std;
const int N = 6e3 + 5, mod = 1e9 + 7;
int n, x[N], y[N];
int vis[2][2];
int gcd(int x, int y) { return !y ? x : gcd(y, x % y); }
int cal(int i, int j) {
  int xx = abs(x[i] - x[j]), yy = abs(y[i] - y[j]);
  xx = gcd(xx, yy);
  return xx * 2;
}
void sol(int cas) {
  sc(n);
  for (int i = 1; i <= n; i++) sc(x[i], y[i]);
  for (int i = 1; i <= n; i++) x[i] >>= 1, y[i] >>= 1, x[i] &= 1, y[i] &= 1;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    memset(vis, 0, sizeof(vis));
    for (int j = n; j >= i + 1; j--) {
      for (int h = 0; h <= 1; h++)
        for (int k = 0; k <= 1; k++) {
          int s = x[i] * y[j] + x[j] * y[i] + x[i] * k + h * y[i] + x[j] * k +
                  h * y[j];
          s &= 1;
          if (s == 0) ans += vis[h][k];
        }
      vis[x[j]][y[j]]++;
    }
  }
  out(ans);
}
void init() {}
int main() {
  srand(time(0));
  init();
  int t = 1, cas = 0;
  while (t--) {
    sol(++cas);
  }
}
