#include <bits/stdc++.h>
using namespace std;
long long cnt[4000100];
map<pair<pair<long long, long long>, pair<long long, long long> >, int> line;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void formalize(long long *a, long long *b) {
  if (*b < 0) {
    *b *= -1;
    *a *= -1;
  }
}
pair<long long, long long> slope(long long x1, long long y1, long long x2,
                                 long long y2) {
  long long x = x2 - x1, y = y2 - y1, g = gcd(abs(x), abs(y));
  if (x == 0) return make_pair(1000000000000000, 1000000000000000);
  if (y == 0) return make_pair(0, 0);
  formalize(&x, &y);
  return make_pair(y / g, x / g);
}
pair<long long, long long> _C_(pair<long long, long long> m, long long x1,
                               long long y1) {
  long long a = (m.second * y1 - m.first * x1), b = m.second,
            g = gcd(abs(a), abs(b));
  if (m.first == 0 && m.second == 0)
    return make_pair(y1, 0);
  else if (m.first == 1000000000000000)
    return make_pair(x1, 0);
  formalize(&a, &b);
  return make_pair(a / g, b / g);
}
long long _nc2_(long long p) { return (1 + (long long)sqrt(1 + 8 * p)) / 2; }
int main() {
  long long x[2010], y[2010], i, j, k, n, sum = 0, indx = 0;
  pair<long long, long long> a, b, m, c;
  pair<pair<long long, long long>, pair<long long, long long> > temp;
  scanf("%I64d", &n);
  for (i = 0; i <= n * n + 5; i++) cnt[i] = 1;
  for (i = 0; i < n; i++) scanf("%I64d%I64d", &x[i], &y[i]);
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      m = slope(x[i], y[i], x[j], y[j]);
      c = _C_(m, x[i], y[i]);
      temp = make_pair(m, c);
      if (line[temp] == 0) line[temp] = ++indx;
      cnt[line[temp]]++;
    }
  }
  for (i = 0; i <= indx; i++) {
    if (cnt[i] > 2) {
      k = _nc2_(cnt[i]);
      sum += (k * (k - 1) * (k - 2)) / 6;
    }
  }
  n = n > 2 ? (n * (n - 1) * (n - 2)) / 6 : 0;
  printf("%I64d\n", n - sum);
  return 0;
}

### Prompt

Please create a solution in cpp to the following problem:

Vanya got bored and he painted n distinct points on the plane. After that he connected all the points pairwise and saw that as a result many triangles were formed with vertices in the painted points. He asks you to count the number of the formed triangles with the non-zero area.

Input

The first line contains integer n (1 ≤ n ≤ 2000) — the number of the points painted on the plane. 

Next n lines contain two integers each xi, yi ( - 100 ≤ xi, yi ≤ 100) — the coordinates of the i-th point. It is guaranteed that no two given points coincide.

Output

In the first line print an integer — the number of triangles with the non-zero area among the painted points.

Examples

Input

4
0 0
1 1
2 0
2 2


Output

3


Input

3
0 0
1 1
2 0


Output

1


Input

1
1 1


Output

0

Note

Note to the first sample test. There are 3 triangles formed: (0, 0) - (1, 1) - (2, 0); (0, 0) - (2, 2) - (2, 0); (1, 1) - (2, 2) - (2, 0).

Note to the second sample test. There is 1 triangle formed: (0, 0) - (1, 1) - (2, 0).

Note to the third sample test. A single point doesn't form a single triangle.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long cnt[4000100];
map<pair<pair<long long, long long>, pair<long long, long long> >, int> line;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void formalize(long long *a, long long *b) {
  if (*b < 0) {
    *b *= -1;
    *a *= -1;
  }
}
pair<long long, long long> slope(long long x1, long long y1, long long x2,
                                 long long y2) {
  long long x = x2 - x1, y = y2 - y1, g = gcd(abs(x), abs(y));
  if (x == 0) return make_pair(1000000000000000, 1000000000000000);
  if (y == 0) return make_pair(0, 0);
  formalize(&x, &y);
  return make_pair(y / g, x / g);
}
pair<long long, long long> _C_(pair<long long, long long> m, long long x1,
                               long long y1) {
  long long a = (m.second * y1 - m.first * x1), b = m.second,
            g = gcd(abs(a), abs(b));
  if (m.first == 0 && m.second == 0)
    return make_pair(y1, 0);
  else if (m.first == 1000000000000000)
    return make_pair(x1, 0);
  formalize(&a, &b);
  return make_pair(a / g, b / g);
}
long long _nc2_(long long p) { return (1 + (long long)sqrt(1 + 8 * p)) / 2; }
int main() {
  long long x[2010], y[2010], i, j, k, n, sum = 0, indx = 0;
  pair<long long, long long> a, b, m, c;
  pair<pair<long long, long long>, pair<long long, long long> > temp;
  scanf("%I64d", &n);
  for (i = 0; i <= n * n + 5; i++) cnt[i] = 1;
  for (i = 0; i < n; i++) scanf("%I64d%I64d", &x[i], &y[i]);
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      m = slope(x[i], y[i], x[j], y[j]);
      c = _C_(m, x[i], y[i]);
      temp = make_pair(m, c);
      if (line[temp] == 0) line[temp] = ++indx;
      cnt[line[temp]]++;
    }
  }
  for (i = 0; i <= indx; i++) {
    if (cnt[i] > 2) {
      k = _nc2_(cnt[i]);
      sum += (k * (k - 1) * (k - 2)) / 6;
    }
  }
  n = n > 2 ? (n * (n - 1) * (n - 2)) / 6 : 0;
  printf("%I64d\n", n - sum);
  return 0;
}

```