#include <bits/stdc++.h>
using namespace std;
priority_queue<long long int, vector<long long int>, greater<long long int>> ti;
vector<long long int> p[300005], a(300005, 0);
long long int f[300005];
map<pair<pair<long long int, long long int>, long long int>, long long int> mp,
    np;
vector<pair<pair<long long int, long long int>, long long int>> st;
map<long long int, long long int> vt;
queue<long long int> qy;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int bpow(long long int a, long long int b) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res % 1000000007;
}
void fact(long long int i) {
  f[0] = 1;
  for (long long int k = 1; k <= i; k++) {
    (f[k] = f[k - 1] * k) %= 1000000007;
  }
}
long long int isprime(long long int n) {
  if (n == 1) return 0;
  for (long long int i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return 0;
  return 1;
}
long long int find(long long int x) {
  if (f[x] == x)
    return x;
  else
    return f[x] = find(f[x]);
}
bool cmp(long long int x, long long int y) { return x < y; }
long long int comb(long long int i, long long int j) {
  long long int k = f[i];
  long long int g = (f[j] * (f[i - j])) % 1000000007;
  long long int h = bpow(g, 1000000007 - 2);
  return (k * h) % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int>> a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  for (long long int i = 0; i < n; i++) {
    long long int x1 = a[i].first, y1 = a[i].second;
    for (long long int j = i + 1; j < n; j++) {
      long long int x2 = a[j].first, y2 = a[j].second;
      long long int d = x2 - x1;
      long long int b = y2 - y1;
      long long int c = y1 * x2 - x1 * y2;
      long long int f = gcd(c, gcd(b, d));
      if (mp[make_pair(make_pair(d / f, b / f), c / f)] == 0)
        st.push_back(make_pair(make_pair(d / f, b / f), c / f));
      mp[make_pair(make_pair(d / f, b / f), c / f)]++;
    }
  }
  long long int h = ((n) * (n - 1) * (n - 2)) / 6;
  for (auto u : st) {
    long long int k = mp[u];
    k = (1 + sqrt(1 + 8 * k)) / 2;
    if (k >= 3) {
      long long int o = ((k) * (k - 1) * (k - 2)) / 6;
      h -= o;
    }
  }
  cout << h << "\n";
}

### Prompt

Please formulate a CPP solution 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;
priority_queue<long long int, vector<long long int>, greater<long long int>> ti;
vector<long long int> p[300005], a(300005, 0);
long long int f[300005];
map<pair<pair<long long int, long long int>, long long int>, long long int> mp,
    np;
vector<pair<pair<long long int, long long int>, long long int>> st;
map<long long int, long long int> vt;
queue<long long int> qy;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int bpow(long long int a, long long int b) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res % 1000000007;
}
void fact(long long int i) {
  f[0] = 1;
  for (long long int k = 1; k <= i; k++) {
    (f[k] = f[k - 1] * k) %= 1000000007;
  }
}
long long int isprime(long long int n) {
  if (n == 1) return 0;
  for (long long int i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return 0;
  return 1;
}
long long int find(long long int x) {
  if (f[x] == x)
    return x;
  else
    return f[x] = find(f[x]);
}
bool cmp(long long int x, long long int y) { return x < y; }
long long int comb(long long int i, long long int j) {
  long long int k = f[i];
  long long int g = (f[j] * (f[i - j])) % 1000000007;
  long long int h = bpow(g, 1000000007 - 2);
  return (k * h) % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int>> a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  for (long long int i = 0; i < n; i++) {
    long long int x1 = a[i].first, y1 = a[i].second;
    for (long long int j = i + 1; j < n; j++) {
      long long int x2 = a[j].first, y2 = a[j].second;
      long long int d = x2 - x1;
      long long int b = y2 - y1;
      long long int c = y1 * x2 - x1 * y2;
      long long int f = gcd(c, gcd(b, d));
      if (mp[make_pair(make_pair(d / f, b / f), c / f)] == 0)
        st.push_back(make_pair(make_pair(d / f, b / f), c / f));
      mp[make_pair(make_pair(d / f, b / f), c / f)]++;
    }
  }
  long long int h = ((n) * (n - 1) * (n - 2)) / 6;
  for (auto u : st) {
    long long int k = mp[u];
    k = (1 + sqrt(1 + 8 * k)) / 2;
    if (k >= 3) {
      long long int o = ((k) * (k - 1) * (k - 2)) / 6;
      h -= o;
    }
  }
  cout << h << "\n";
}

```