#include <bits/stdc++.h>
using namespace std;
long long ceildiv(long long one, long long two) {
  if (one % two == 0) {
    return one / two;
  } else {
    return one / two + 1;
  }
}
long long power(long long n, long long pow, long long m) {
  if (pow == 0) return 1;
  if (pow % 2 == 0) {
    long long x = power(n, pow / 2, m);
    return (x * x) % m;
  } else
    return (power(n, pow - 1, m) * n) % m;
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long factorial(long long n, long long mod) {
  if (n > 1)
    return (n * factorial(n - 1, mod)) % mod;
  else
    return 1;
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
vector<long long> read(long long n) {
  vector<long long> a;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a.push_back(x);
  }
  return a;
}
vector<vector<long long>> adj;
void init(long long n) {
  for (long long i = 0; i <= n; i++) {
    vector<long long> a;
    adj.push_back(a);
  }
}
void solve() {
  long long n;
  cin >> n;
  vector<pair<long long, long long>> pnt;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    pnt.push_back({x, y});
  }
  vector<map<pair<pair<long long, long long>, long long>, long long>> line;
  map<pair<pair<long long, long long>, long long>, long long> mp;
  line.assign(n + 1, mp);
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (i == j) {
        continue;
      }
      long long a = pnt[i].second - pnt[j].second;
      long long b = pnt[j].first - pnt[i].first;
      long long c = -a * pnt[i].first - b * pnt[i].first;
      long long g = gcd(abs(a), abs(b));
      g = gcd(g, abs(c));
      a /= g;
      b /= g;
      c /= g;
      if (a < 0 || (a == 0 && b < 0)) {
        a *= -1;
        b *= -1;
        c *= -1;
      }
      line[i][make_pair(make_pair(a, b), c)]++;
    }
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (i == j) {
        continue;
      }
      long long a = pnt[i].second - pnt[j].second;
      long long b = pnt[j].first - pnt[i].first;
      long long c = -a * pnt[i].first - b * pnt[i].first;
      long long g = gcd(abs(a), abs(b));
      g = gcd(g, abs(c));
      a /= g;
      b /= g;
      c /= g;
      if (a < 0 || (a == 0 && b < 0)) {
        a *= -1;
        b *= -1;
        c *= -1;
      }
      ans += n - 1 - line[i][make_pair(make_pair(a, b), c)];
    }
  }
  cout << ans / 6 << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
}

### Prompt

Please provide a cpp coded solution to the problem described below:

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 ceildiv(long long one, long long two) {
  if (one % two == 0) {
    return one / two;
  } else {
    return one / two + 1;
  }
}
long long power(long long n, long long pow, long long m) {
  if (pow == 0) return 1;
  if (pow % 2 == 0) {
    long long x = power(n, pow / 2, m);
    return (x * x) % m;
  } else
    return (power(n, pow - 1, m) * n) % m;
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long factorial(long long n, long long mod) {
  if (n > 1)
    return (n * factorial(n - 1, mod)) % mod;
  else
    return 1;
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
vector<long long> read(long long n) {
  vector<long long> a;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a.push_back(x);
  }
  return a;
}
vector<vector<long long>> adj;
void init(long long n) {
  for (long long i = 0; i <= n; i++) {
    vector<long long> a;
    adj.push_back(a);
  }
}
void solve() {
  long long n;
  cin >> n;
  vector<pair<long long, long long>> pnt;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    pnt.push_back({x, y});
  }
  vector<map<pair<pair<long long, long long>, long long>, long long>> line;
  map<pair<pair<long long, long long>, long long>, long long> mp;
  line.assign(n + 1, mp);
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (i == j) {
        continue;
      }
      long long a = pnt[i].second - pnt[j].second;
      long long b = pnt[j].first - pnt[i].first;
      long long c = -a * pnt[i].first - b * pnt[i].first;
      long long g = gcd(abs(a), abs(b));
      g = gcd(g, abs(c));
      a /= g;
      b /= g;
      c /= g;
      if (a < 0 || (a == 0 && b < 0)) {
        a *= -1;
        b *= -1;
        c *= -1;
      }
      line[i][make_pair(make_pair(a, b), c)]++;
    }
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (i == j) {
        continue;
      }
      long long a = pnt[i].second - pnt[j].second;
      long long b = pnt[j].first - pnt[i].first;
      long long c = -a * pnt[i].first - b * pnt[i].first;
      long long g = gcd(abs(a), abs(b));
      g = gcd(g, abs(c));
      a /= g;
      b /= g;
      c /= g;
      if (a < 0 || (a == 0 && b < 0)) {
        a *= -1;
        b *= -1;
        c *= -1;
      }
      ans += n - 1 - line[i][make_pair(make_pair(a, b), c)];
    }
  }
  cout << ans / 6 << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
}

```