#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& a) {
  char c = getchar();
  int f = 1;
  a = 0;
  for (; c > '9' || c < '0'; c = getchar())
    if (c == '-') f = -1;
  for (; c <= '9' && c >= '0'; c = getchar()) a = a * 10 + c - 48;
  a *= f;
}
int n, cnt[2][2];
long long s, ans;
int main() {
  read(n);
  for (int i, j; n--;) read(i), read(j), ++cnt[(i >> 1) & 1][(j >> 1) & 1];
  for (int i1 = 0; i1 < 2; ++i1)
    for (int j1 = 0; j1 < 2; ++j1)
      if (cnt[i1][j1]) {
        s = cnt[i1][j1]--;
        for (int i2 = 0; i2 < 2; ++i2)
          for (int j2 = 0; j2 < 2; ++j2)
            if (cnt[i2][j2]) {
              s *= cnt[i2][j2]--;
              for (int i3 = 0; i3 < 2; ++i3)
                for (int j3 = 0; j3 < 2; ++j3)
                  if (((i1 - i2 || j1 - j2) + (i1 - i3 || j1 - j3) +
                       (i2 - i3 || j2 - j3)) %
                          2 ==
                      0)
                    ans += s * cnt[i3][j3];
              s /= ++cnt[i2][j2];
            }
        ++cnt[i1][j1];
      }
  printf("%lld", ans / 6);
  return 0;
}

### Prompt

Develop a solution in cpp to the problem described below:

This is the easy version of the problem. The only difference from the hard version is that in this version all coordinates are even.

There are n fence-posts at distinct coordinates on a plane. It is guaranteed that no three fence posts lie on the same line.

There are an infinite number of cows on the plane, one at every point with integer coordinates.

Gregor is a member of the Illuminati, and wants to build a triangular fence, connecting 3 distinct existing fence posts. A cow strictly inside the fence is said to be enclosed. If there are an odd number of enclosed cows and the area of the fence is an integer, the fence is said to be interesting.

Find the number of interesting fences.

Input

The first line contains the integer n (3 ≤ n ≤ 6000), the number of fence posts which Gregor can choose to form the vertices of a fence.

Each of the next n line contains two integers x and y (0 ≤ x,y ≤ 10^7, x and y are even), where (x,y) is the coordinate of a fence post. All fence posts lie at distinct coordinates. No three fence posts are on the same line.

Output

Print a single integer, the number of interesting fences. Two fences are considered different if they are constructed with a different set of three fence posts.

Examples

Input


3
0 0
2 0
0 4


Output


1


Input


5
0 0
2 16
30 14
4 6
2 10


Output


3

Note

In the first example, there is only 1 fence. That fence is interesting since its area is 4 and there is 1 enclosed cow, marked in red.

<image>

In the second example, there are 3 interesting fences. 

  * (0,0) — (30,14) — (2,10) 
  * (2,16) — (30,14) — (2,10) 
  * (30,14) — (4,6) — (2,10) 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& a) {
  char c = getchar();
  int f = 1;
  a = 0;
  for (; c > '9' || c < '0'; c = getchar())
    if (c == '-') f = -1;
  for (; c <= '9' && c >= '0'; c = getchar()) a = a * 10 + c - 48;
  a *= f;
}
int n, cnt[2][2];
long long s, ans;
int main() {
  read(n);
  for (int i, j; n--;) read(i), read(j), ++cnt[(i >> 1) & 1][(j >> 1) & 1];
  for (int i1 = 0; i1 < 2; ++i1)
    for (int j1 = 0; j1 < 2; ++j1)
      if (cnt[i1][j1]) {
        s = cnt[i1][j1]--;
        for (int i2 = 0; i2 < 2; ++i2)
          for (int j2 = 0; j2 < 2; ++j2)
            if (cnt[i2][j2]) {
              s *= cnt[i2][j2]--;
              for (int i3 = 0; i3 < 2; ++i3)
                for (int j3 = 0; j3 < 2; ++j3)
                  if (((i1 - i2 || j1 - j2) + (i1 - i3 || j1 - j3) +
                       (i2 - i3 || j2 - j3)) %
                          2 ==
                      0)
                    ans += s * cnt[i3][j3];
              s /= ++cnt[i2][j2];
            }
        ++cnt[i1][j1];
      }
  printf("%lld", ans / 6);
  return 0;
}

```