#include <cstdio>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;
#define EPS 1e-9
int n;
map<pair<double,double>,int> m;
vector<pair<int,int>> v;
int main (){
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(make_pair(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?0x7fffffff:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            m[make_pair(r,x)]++;
        }
    }
    int ans=n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=x.second;
        ans-=num*(num-1)/6;
    }
    printf("%d\n",ans);

}


#include <cstdio>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
using namespace std;
unordered_map<int,int> magic;
#define EPS 1e-7
int n;
class cmp{
public:
    bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(make_pair(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?400:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            if(dify==0)x=v[i].second;
            auto it=m.find(make_pair(r,x));
            if(it==m.end())m[make_pair(r,x)]=1;
            else it->second++;
        }
    }
    long long ans=(long long)n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=magic[x.second];
        if(num==0){
            printf("!!");
            printf("%lf %lf %d\n",x.first.first,x.first.second,x.second);
        }
        ans-=(long long)num*(num-1)*(num-2)/6;
    }
    printf("%I64d\n",ans);

}


#include <cstdio>
#include <map>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
#define EPS 1e-9
int n;
class cmp{
public:
    bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(make_pair(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?0x7fffffff:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            m[make_pair(r,x)]++;
        }
    }
    int ans=n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=x.second;
        ans-=num*(num-1)/6;
    }
    printf("%d\n",ans);

}


#include <cstdio>
#include <map>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
map<int,int> magic;
#define EPS 1e-9
int n;
class cmp{
public:
    bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(make_pair(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?0x7fffffff:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            m[make_pair(r,x)]++;
        }
    }
    int ans=n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=magic[x.second];
        ans-=num*(num-1)*(num-2)/6;
    }
    printf("%d\n",ans);

}


#include <cstdio>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
using namespace std;
unordered_map<int,int> magic;
#define EPS 1e-9
int n;
class cmp{
public:
    inline bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(pair<int,int>(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?400:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            if(dify==0)x=v[i].second;
            m[pair<double,double>(r,x)]++;
        }
    }
    long long ans=(long long)n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=magic[x.second];
        ans-=(long long)num*(num-1)*(num-2)/6;
    }
    printf("%I64d\n",ans);

}


#include <cstdio>
#include <map>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
map<int,int> magic;
#define EPS 1e-7
int n;
class cmp{
public:
    bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(make_pair(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?0x7fffffff:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            m[make_pair(r,x)]++;
        }
    }
    int ans=n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=magic[x.second];
        ans-=num*(num-1)*(num-2)/6;
    }
    printf("%d\n",ans);

}


#include <cstdio>
#include <map>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
using namespace std;
map<int,int> magic;
#define EPS 1e-7
int n;
class cmp{
public:
    bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(make_pair(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?400:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            if(dify==0)x=v[i].second;
            auto it=m.find(make_pair(r,x));
            if(it==m.end())m[make_pair(r,x)]=1;
            else it->second++;
        }
    }
    long long ans=(long long)n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=magic[x.second];
        if(num==0){
            printf("!!");
            printf("%lf %lf %d\n",x.first.first,x.first.second,x.second);
        }
        ans-=(long long)num*(num-1)*(num-2)/6;
    }
    printf("%d\n",ans);

}


#include <cstdio>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
using namespace std;
unordered_map<int,int> magic;
#define EPS 1e-7
int n;
class cmp{
public:
    inline bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(pair<int,int>(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?400:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            if(dify==0)x=v[i].second;
            m[pair<double,double>(r,x)]++;
        }
    }
    long long ans=(long long)n*(n-1)*(n-2)/6;
    for(const auto& x:m){
        int num=magic[x.second];
        ans-=(long long)num*(num-1)*(num-2)/6;
    }
    printf("%I64d\n",ans);

}


#include <cstdio>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
using namespace std;
unordered_map<int,int> magic;
#define EPS 0
int n;
class cmp{
public:
    inline bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(pair<int,int>(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?400:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            if(dify==0)x=v[i].second;
            m[pair<double,double>(r,x)]++;
        }
    }
    long long ans=(long long)n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=magic[x.second];
        ans-=(long long)num*(num-1)*(num-2)/6;
    }
    printf("%I64d\n",ans);

}


#include <cstdio>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
using namespace std;
unordered_map<int,int> magic;
#define EPS 1e-7
int n;
class cmp{
public:
    inline bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(pair<int,int>(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?400:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            if(dify==0)x=v[i].second;
            m[pair<double,double>(r,x)]++;
        }
    }
    long long ans=(long long)n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=magic[x.second];
        ans-=(long long)num*(num-1)*(num-2)/6;
    }
    printf("%I64d\n",ans);

}


#include <cstdio>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
using namespace std;
unordered_map<int,int> magic;
#define EPS 1e-6
int n;
class cmp{
public:
    inline bool operator()(const pair<double,double>& x,const pair<double,double>& y)const{
        if(abs(x.first-y.first)<EPS){
            if(abs(x.second-y.second)<EPS)return false;
            return x.second<y.second;
        }
        return x.first<y.first;
    }
};
map<pair<double,double>,int,cmp> m;
vector<pair<int,int>> v;
int main (){
    for(int i = 1 ; i < 2001 ; i ++){
        magic[i*(i-1)/2]=i;
    }
    scanf("%d",&n);
    for(int i = 0 ; i < n ; i ++){
        int x,y;
        scanf("%d%d",&x,&y);
        v.push_back(pair<int,int>(x,y));
    }
    for(int i = 0 ; i < v.size() ; i ++){
        for(int j = i +1 ; j < v.size() ; j ++){
            double difx=v[i].first-v[j].first;
            double dify=v[i].second-v[j].second;
            double r=difx==0?400:dify/difx;
            double x=difx==0?v[i].first:(double)v[i].first-(double)(v[i].second/dify)*difx;
            if(dify==0)x=v[i].second;
            m[pair<double,double>(r,x)]++;
        }
    }
    long long ans=(long long)n*(n-1)*(n-2)/6;
    for(auto x:m){
        int num=magic[x.second];
        ans-=(long long)num*(num-1)*(num-2)/6;
    }
    printf("%I64d\n",ans);

}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 201;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
unordered_multiset <int> m[M][2 * M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

ll getn(ll n) {
    return 1 + (int)(sqrt(2 * n));
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
        x1[i] += 100, y1[i] += 100;
    }

    fr(i, n)
        frab(j, i + 1, n)
            if (i != j) {
                ll b = x1[j] - x1[i], a = y1[i] - y1[j], c = x1[i] * (y1[i] - y1[j]) + y1[i] * (x1[j] - x1[i]);
                if (a < 0) a *= -1, b *= -1, c *= -1;
                if (a == 0 && b < 0) b *= -1, c*= -1;
//                ll gcd = __gcd(__gcd(a, b), c);
//                a /= gcd, b /= gcd, c /= gcd;
//                m[x + M / 2][y + M / 2]++;
                m[a][b + M].insert(c);
            }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, 2 * M)
            ans -= f(getn((int)m[i][j].size()));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 211;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
unordered_map <int, int> m[M][2 * M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

ll getn(ll n) {
    return 1 + (int)(sqrt(2 * n));
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
        x1[i] += 100, y1[i] += 100;
    }

    fr(i, n)
        frab(j, i + 1, n) {
            ll b = x1[j] - x1[i], a = y1[i] - y1[j], c = x1[i] * (y1[i] - y1[j]) + y1[i] * (x1[j] - x1[i]);
            if (a < 0) a *= -1, b *= -1, c *= -1;
            if (a == 0 && b < 0) b *= -1, c*= -1;
            m[a][b + M][c]++;
        }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, 2 * M)
            for (auto it = m[i][j].begin(); it != m[i][j].end(); it++)
                ans -= f(getn(it->second));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 1300;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
ll m[M][M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
    }
    fr(i, n)
        frab(j, i + 1, n) {
            ll x = x1[i] - x1[j], y = y1[i] - y1[j];
            ll gcd = __gcd(x, y);
            x /= gcd, y /= gcd;
            if (x < 0) x *= -1, y *= -1;
            if (x == 0 && y < 0) y *= -1;
            m[x + M / 2][y + M / 2]++;
        }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, M)
            ans -= f(m[i][j]);
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 1300;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
ll m[M][M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

ll getn(ll n) {
    int l = 0, r = 2001;
    while (r - l > 1) {
        int m = (l + r) / 2;
        if (m * (m - 1) == n)
            return m;
        if (m * (m - 1) < n)
            l = m;
        else
            r = m;
    }
    if (l * (l - 1) == n)
        return l;
    return r;
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
    }
    fr(i, n)
        fr(j, n)
            if (i != j) {
                ll x = x1[i] - x1[j], y = y1[i] - y1[j];
                if (x < 0) x *= -1, y *= -1;
                if (x == 0 && y < 0) y *= -1;
                ll gcd = __gcd(x, y);
                x /= gcd, y /= gcd;
                m[x + M / 2][y + M / 2]++;
            }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, M)
            ans -= f(getn(m[i][j]));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 1300;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

int x1[N], y1[N];
int m[M][M];

ll f(ll n) {
    return n * (n - 1) * (n - 2) / 6;
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
    }
    fr(i, n)
        frab(j, i + 1, n) {
            int x = x1[i] - x1[j], y = y1[i] - y1[j];
            int gcd = __gcd(x, y);
            x /= gcd, y /= gcd;
            if (x < 0) x *= -1, y *= -1;
            if (x == 0 && y < 0) y *= -1;
            m[x + M / 2][y + M / 2]++;
        }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, M)
            ans -= f(m[i][j]);
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 1300;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
ll m[M][M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
    }
    fr(i, n)
        fr(j, n)
            if (i != j) {
                ll x = x1[i] - x1[j], y = y1[i] - y1[j];
                if (x < 0) x *= -1, y *= -1;
                if (x == 0 && y < 0) y *= -1;
                ll gcd = __gcd(x, y);
                x /= gcd, y /= gcd;
                m[x + M / 2][y + M / 2]++;
            }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, M)
            ans -= f(1 + (int)(sqrt(m[i][j])));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 211;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
unordered_map <int, int> m[M][2 * M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

ll getn(ll n) {
    return 1 + (int)(sqrt(2 * n));
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
        x1[i] += 100, y1[i] += 100;
    }

    fr(i, n)
        frab(j, i + 1, n) {
            ll b = x1[j] - x1[i], a = y1[i] - y1[j], c = x1[i] * (y1[i] - y1[j]) + y1[i] * (x1[j] - x1[i]);
            if (a < 0) a *= -1, b *= -1, c *= -1;
            if (a == 0 && b < 0) b *= -1, c *= -1;
            ll gcd = __gcd(__gcd(abs(a), abs(b)), abs(c));
            a /= gcd, b /= gcd, c /= gcd;
            m[a][b + M][c]++;
        }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, 2 * M)
            for (auto it = m[i][j].begin(); it != m[i][j].end(); it++)
                ans -= f(getn(it->second));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 201;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
unordered_map <int, int> m[M][2 * M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

ll getn(ll n) {
    return 1 + (int)(sqrt(2 * n));
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
        x1[i] += 100, y1[i] += 100;
    }

    fr(i, n)
        frab(j, i + 1, n)
            if (i != j) {
                ll b = x1[j] - x1[i], a = y1[i] - y1[j], c = x1[i] * (y1[i] - y1[j]) + y1[i] * (x1[j] - x1[i]);
                if (a < 0) a *= -1, b *= -1, c *= -1;
                if (a == 0 && b < 0) b *= -1, c*= -1;
                m[a][b + M][c]++;
            }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, 2 * M)
            for (auto it:m[i][j])
                ans -= f(getn(it.second));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 211;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
unordered_map <int, int> m[M][2 * M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

ll getn(ll n) {
    return 1 + (int)(sqrt(2 * n));
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
        x1[i] += 100, y1[i] += 100;
    }

    fr(i, n)
        frab(j, i + 1, n) {
            ll b = x1[j] - x1[i], a = y1[i] - y1[j], c = x1[i] * (y1[i] - y1[j]) + y1[i] * (x1[j] - x1[i]);
            if (a < 0) a *= -1, b *= -1, c *= -1;
            if (a == 0 && b < 0) b *= -1, c *= -1;
            ll gcd = __gcd(__gcd(a, b), c);
            a /= gcd, b /= gcd, c /= gcd;
            m[a][b + M][c]++;
        }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, 2 * M)
            for (auto it = m[i][j].begin(); it != m[i][j].end(); it++)
                ans -= f(getn(it->second));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 201;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
unordered_map <int, int> m[M][2 * M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

ll getn(ll n) {
    return 1 + (int)(sqrt(2 * n));
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
        x1[i] += 100, y1[i] += 100;
    }

    fr(i, n)
        frab(j, i + 1, n) {
            ll b = x1[j] - x1[i], a = y1[i] - y1[j], c = x1[i] * (y1[i] - y1[j]) + y1[i] * (x1[j] - x1[i]);
            if (a < 0) a *= -1, b *= -1, c *= -1;
            if (a == 0 && b < 0) b *= -1, c*= -1;
            m[a][b + M][c]++;
        }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, 2 * M)
            for (auto it = m[i][j].begin(); it != m[i][j].end(); it++)
                ans -= f(getn(it->second));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 1300;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
ll m[M][M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
    }
    fr(i, n)
        frab(j, i + 1, n) {
            ll x = x1[i] - x1[j], y = y1[i] - y1[j];
            ll gcd = __gcd(x, y);
            x /= gcd, y /= gcd;
            if (x < 0) x *= -1, y *= -1;
            if (x == 0 && y < 0) y *= -1;
            m[x + M / 2][y + M / 2]++;
        }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, M)
            ans -= f(1 + (int)sqrt(2 * m[i][j]));
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 1300;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
ll m[M][M];

ll f(ll n) {
    return n * (n - 1) * (n - 2) / 6;
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
    }
    fr(i, n)
        frab(j, i + 1, n) {
            ll x = x1[i] - x1[j], y = y1[i] - y1[j];
            ll gcd = __gcd(x, y);
            x /= gcd, y /= gcd;
            if (x < 0) x *= -1, y *= -1;
            if (x == 0 && y < 0) y *= -1;
            m[x + M / 2][y + M / 2]++;
        }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, M)
            ans -= f(m[i][j]);
    cout << ans;
}


#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef pair <int, int> pr;
typedef long long ll;
typedef long double ld;

const ll MOD = 1073741824;
const ll INF = 2e9;
const ll N = 1e5 + 2;
const ll M = 1300;
const ll MAX = 2e5 + 2;
const ld EPS = 1e-6;

ll x1[N], y1[N];
ll m[M][M];

ll f(ll n) {
    if (n <= 2)
        return 0;
    return n * (n - 1) * (n - 2) / 6;
}

ll getn(ll n) {
    ll l = 0, r = 2001;
    while (r - l > 1) {
        ll m = (l + r) / 2;
        if (m * (m - 1) == n)
            return m;
        if (m * (m - 1) < n)
            l = m;
        else
            r = m;
    }
    if (l * (l - 1) == n)
        return l;
    return r;
}

int main() {
    //ios_base::sync_with_stdio(false);
    //cout << fixed << setprecision(8);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll n;
    cin >> n;
    fr(i, n) {
        cin >> x1[i] >> y1[i];
    }
    fr(i, n)
        fr(j, n)
            if (i != j) {
                ll x = x1[i] - x1[j], y = y1[i] - y1[j];
                if (x < 0) x *= -1, y *= -1;
                if (x == 0 && y < 0) y *= -1;
                ll gcd = __gcd(x, y);
                x /= gcd, y /= gcd;
                m[x + M / 2][y + M / 2]++;
            }

    if (n <= 2) {
        cout << 0;
        return 0;
    }
    ll ans = f(n);
    fr(i, M)
        fr(j, M)
            ans -= f(getn(m[i][j]));
    cout << ans;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;
int reversee[1000000];
int gcd[201][201];
map<long long, int > hashh;

 int mygcd(int a, int b) {
        return gcd[abs(a)][abs(b)];
    }
bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (double)(p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	 for (int i = 0; i <= 200; i++) {
            gcd[i][i] = i;
            for (int j = 0; j < i; j++)
                gcd[j][i] = gcd[i][j] = (j == 0) ? i : gcd[j][i % j];
        }
	for(int i = 0 ;  i < 1000;  i++){
		reversee[i*(i-1)/2]=i;
	}
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			//pair<double,double> current =  xAndSlope(points[i],points[j]);
		//	slopes[current]++;
			int A = points[i].second - points[j].second, B = -points[i].first + points[j].first;
                int C = A * points[i].first + B * points[i].second;
                int g = mygcd(A, B);
                A /= g;
                B /= g;
                C /= g;
                if (A < 0 || (A == 0 && B < 0)) {
                    A = -A;
                    B = -B;
                    C = -C;
                }
                long hsh = C * 500 * 1LL * 500 + (A + 250) * 500 + B;
                hashh[hsh]++;
		}
	}

	/*
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-4 && abs(it->first.second-prev->first.second) <1e-4){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);

	*/
	long long ans = 1LL*n*(n-1)*(n-2)/6;
	/*
	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now=reversee[now];
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}*/

	for(auto it : hashh){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current = reversee[current];
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;
int reversee[1000000];
int gcd[201][201];
map<long long, int > hashh;

 int mygcd(int a, int b) {
        return gcd[abs(a)][abs(b)];
    }
bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (double)(p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {

	 for (int i = 0; i <= 200; i++) {
            gcd[i][i] = i;
            for (int j = 0; j < i; j++)
                gcd[j][i] = gcd[i][j] = (j == 0) ? i : gcd[j][i % j];
        }
	for(int i = 0 ;  i < 1000;  i++){
		reversee[i*(i-1)/2]=i;
	}
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			//pair<double,double> current =  xAndSlope(points[i],points[j]);
		//	slopes[current]++;
			int A = points[i].second - points[j].second, B = -points[i].first + points[j].first;
                int C = A * points[i].first + B * points[i].second;
                int g = mygcd(A, B);
                A /= g;
                B /= g;
                C /= g;
                if (A < 0 || (A == 0 && B < 0)) {
                    A = -A;
                    B = -B;
                    C = -C;
                }
                long long hsh = C * 500 * 1LL * 500 + (A + 250) * 500 + B;
                hashh[hsh]++;
		}
	}

	/*
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-4 && abs(it->first.second-prev->first.second) <1e-4){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);

	*/
	long long ans = 1LL*n*(n-1)*(n-2)/6;
	/*
	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now=reversee[now];
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}*/

	for(auto it : hashh){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current = reversee[current];
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;
int reversee[1000000];

bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (double)(p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	for(int i = 0 ;  i < 1000;  i++){
		reversee[i*(i-1)/2]=i;
	}
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			pair<double,double> current =  xAndSlope(points[i],points[j]);
			slopes[current]++;
		}
	}
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-5 && abs(it->first.second-prev->first.second) <1e-5){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);
	long long ans = n*(n-1)*(n-2)/6;

	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now=reversee[now];
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;
int reversee[1000000];

bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (double)(p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	for(int i = 0 ;  i < 1000;  i++){
		reversee[i*(i-1)/2]=i;
	}
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			pair<double,double> current =  xAndSlope(points[i],points[j]);
			slopes[current]++;
		}
	}
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-4 && abs(it->first.second-prev->first.second) <1e-4){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);
	long long ans = 1LL*n*(n-1)*(n-2)/6;

	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now=reversee[now];
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;
int reversee[1000000];
int gcd[201][201];
map<long long, int > hashh;

 int mygcd(int a, int b) {
        return gcd[abs(a)][abs(b)];
    }
bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (double)(p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	 for (int i = 0; i <= 200; i++) {
            gcd[i][i] = i;
            for (int j = 0; j < i; j++)
                gcd[j][i] = gcd[i][j] = (j == 0) ? i : gcd[j][i % j];
        }
	for(int i = 0 ;  i < 1000;  i++){
		reversee[i*(i-1)/2]=i;
	}
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			//pair<double,double> current =  xAndSlope(points[i],points[j]);
		//	slopes[current]++;
			int A = points[i].second - points[j].second, B = -points[i].first + points[j].first;
                int C = A * points[i].first + B * points[i].second;
                int g = mygcd(A, B);
                A /= g;
                B /= g;
                C /= g;
                if (A < 0 || (A == 0 && B < 0)) {
                    A = -A;
                    B = -B;
                    C = -C;
                }
                long hsh = C * 500 * 1LL * 500 + (A + 250) * 500 + B;
                hashh[hsh]++;
		}
	}

	/*
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-4 && abs(it->first.second-prev->first.second) <1e-4){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);

	*/
	long long ans = 1LL*n*(n-1)*(n-2)/6;
	/*
	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now=reversee[now];
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}*/

	for(auto it : hashh){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;
int reversee[1000000];

bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (double)(p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	for(int i = 0 ;  i < 1000;  i++){
		reversee[i*(i-1)/2]=i;
	}
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			pair<double,double> current =  xAndSlope(points[i],points[j]);
			slopes[current]++;
		}
	}
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-4 && abs(it->first.second-prev->first.second) <1e-4){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);
	long long ans = 1LL*n*(n-1)*(n-2)/6;
	/*
	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now=reversee[now];
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}*/

	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;

bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	int n;
	cin>>n;
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			pair<double,double> current =  xAndSlope(points[i],points[j]);
			slopes[current]++;
		}
	}
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-5 && abs(it->first.second-prev->first.second) <1e-5){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);
	long long ans = n*(n-1)*(n-2)/6;

	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now *=2;
		now = sqrt(now)+1;
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;

bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			pair<double,double> current =  xAndSlope(points[i],points[j]);
			slopes[current]++;
		}
	}
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-5 && abs(it->first.second-prev->first.second) <1e-5){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);
	long long ans = n*(n-1)*(n-2)/6;

	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now *=2;
		now = sqrt(now)+1;
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;

map<double,int> x;
map<int,int> intersect;
vector<pair<int,int> > points;
int main(int argc, char** argv) {
	int n;
	cin>>n;
	for(int i = 0; i  < n ; i ++){
		int x,y;
		cin>>x>>y;
		points.push_back(make_pair(x,y));
	}
	for(int i= 0 ; i < n; i++){
		for(int j = i+1 ; j  < n ; j++){
			if(i!=j) {
				if(points[i].first - points[j].first == 0){

					intersect[points[i].first]++;

				}  else {

					x[(points[i].second-points[j].second)/(points[i].first-points[j].first)]++;

				}
			}
		}
	}
	long long ans = n*(n-1)*(n-2)/6;

	for(map<double,int>::iterator it =x.begin() ; it!= x.end() ;it++){
		long long  cur =(long long) it->second;
			if(cur>2){
				ans-=(cur)*(cur-1)*(cur-2)/6;
			}
	}

		for(map<int,int>::iterator it =intersect.begin() ; it!= intersect.end() ;it++){
		long long  cur =(long long) it->second;
			if(cur>2){
				ans-=(cur)*(cur-1)*(cur-2)/6;
			}
	}
	cout<<ans;

	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;
int reversee[1000000];

bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (double)(p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	for(int i = 0 ;  i < 1000;  i++){
		reversee[i*(i-1)/2]=i;
	}
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			pair<double,double> current =  xAndSlope(points[i],points[j]);
			slopes[current]++;
		}
	}
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-5 && abs(it->first.second-prev->first.second) <1e-5){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);
	long long ans = 1LL*n*(n-1)*(n-2)/6;

	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now=reversee[now];
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;
vector<int> values;
int reversee[1000000];

bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {
	for(int i = 0 ;  i < 1000;  i++){
		reversee[i*(i-1)/2]=i;
	}
	int n;
	cin>>n;
	if(n<=2) {
		cout<<0;
		return 0;
	}
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){

			pair<double,double> current =  xAndSlope(points[i],points[j]);
			slopes[current]++;
		}
	}
	map<pair<double,double>,int >::iterator it = slopes.begin();
	map<pair<double,double>,int >::iterator prev = it;
	it++;
	int current = 0;
	while(it!=slopes.end()){

		if(abs(it->first.first-prev->first.first) < 1e-5 && abs(it->first.second-prev->first.second) <1e-5){
			current+=prev->second;
			it++;
		}else {
			if(current!=0){
				values.push_back(current);
			}else {
				values.push_back(prev->second);
			}
			current = 0;
			prev= it;
			it++;
		}
	}
	current+=slopes.rbegin()->second;
	values.push_back(current);
	long long ans = n*(n-1)*(n-2)/6;

	for(int i = 0; i  < values.size(); i++){
		long long now = 1LL*values[i];

			if(now <= 1) continue;
		now=reversee[now];
		now =now*(now-1)*(now-2)/6;

		ans-=now;
	}
	/*
	for(auto it : slopes){
		long long current = 1LL*it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}*/
	cout<<ans;
	return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
map<pair<double,double>,int> slopes;
vector<pair<int,int> > points;
double inf =1e9;

bool cmp(pair<int,int> p1,pair<int,int> p2){
	if(p1.first<p2.first) return true;
	if(p1.first== p2.first){
		if(p1.second<p2.second) return true;

	}
	return false;
}
pair<double,double> xAndSlope(pair<int,int> p1 , pair<int,int> p2){
	double slope = p1.first==p2.first ? inf : (p2.second-p1.second)/(p2.first-p1.first);
	double xInterSect = p1.first==p2.first ? p1.first : p1.second== p2.second ? p2.second : p1.first-(double)p1.second/slope;
	return make_pair(xInterSect,slope);
}
int main(int argc, char** argv) {

	int n;
	cin>>n;
	for(int i = 0 ; i < n; i++){
		int x, y;
		scanf("%d%d",&x,&y);
		points.push_back(make_pair(x,y));
	}
	sort(points.begin(),points.end(),cmp);
	for(int i = 0 ; i < n ; i++){
		for(int j = i+1 ; j < n ; j++){
			pair<double,double> current =  xAndSlope(points[i],points[j]);
			slopes[current]++;
		}
	}
	long long ans = n*(n-1)*(n-2)/6;
	for(auto it : slopes){
		int current = it.second;
		if(current <= 1) continue;
		current *=2;
		current = sqrt(current)+1;
		current = current*(current-1)*(current-2)/6;
		ans-=current;

	}
	cout<<ans;
	return 0;
}


#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<cmath>
using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef pair<int,ii > iii;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector< pair<double, ii> > vdii;
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ull unsigned long long int
#define ll unsigned long long int
#define F first
#define S second

vii p;
map<ll,set<ii > > m;
set<ii> infs;

int gcd(int a,int b)
{
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll get_line(const ii &p1,const ii &p2)
{
    int a = p2.first - p1.first;
    int b = p1.second - p2.second;
    int c = p1.first*(p2.second-p1.second) - p1.second*(p2.first-p1.first);

    int gd = 1;

    if(a == 0)
    {
        if(c == 0)
        {
            b = 1;
        }
        else
        {
            if(b < 0)
            {
                b *= -1;
                c *= -1;
            }
            gd = gcd(abs(b),abs(c));
        }
    }
    else
    {
        if(b == 0)
        {
            if(c == 0)
            {
                a = 1;
            }
            else
            {
                if(a < 0)
                {
                    a *= -1;
                    c *= -1;
                }
                gd = gcd(abs(a),abs(c));
            }
        }
        else
        {
            if(c == 0)
            {
                if(a < 0)
                {
                    a *= -1;
                    b *= -1;
                }
                gd = gcd(abs(a),abs(b));
            }
            else
            {
                if(a < 0)
                {
                    a *= -1;
                    b *= -1;
                    c *= -1;
                }
                gd = gcd(abs(a),gcd(abs(b),abs(c)));
            }
        }
    }

    //int gd = gcd(abs(a) ? abs(a) : 1,gcd(abs(b) ? abs(b) : 1,abs(c) ? abs(c) : 1));
    a /= gd;
    b /= gd;
    c /= gd;

    return 29000000LL*a + 1300000LL * b + 1900LL *c;
}

int main()
{
    int n;
    ll hsh;
    cin>>n;
    int x,y;
    rep(i,0,n-1)
    {
        cin>>x>>y;
        p.pb(mp(x,y));
    }
    ull res = (n * 1LL * (n-1) * (n-2))/6;

    rep(i,0,n-1)
    {
        rep(j,i+1,n-1)
        {
            ll hsh = get_line(p[i],p[j]);
            m[hsh].insert(p[i]);
            m[hsh].insert(p[j]);
        }
    }

    ull rem = 0;
    int siz;

    map<ll,set<ii> >::iterator it;
    tr(m,it)
    {
         siz = sz(it->S);
         rem += (siz * 1LL * (siz-1) * (siz-2))/6;
    }
    res -= rem;
    cout<<res<<endl;
    return 0;
}


#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<cmath>
using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef pair<int,ii > iii;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector< pair<double, ii> > vdii;
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ull unsigned long long int
#define ll unsigned long long int
#define F first
#define S second

vii p;
map<ll,set<ii > > m;
set<ii> infs;

int gcd(int a,int b)
{
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll get_line(const ii &p1,const ii &p2)
{
    int a = p2.first - p1.first;
    int b = p1.second - p2.second;
    int c = p1.first*(p2.second-p1.second) - p1.second*(p2.first-p1.first);

    int gd = 1;

    if(a == 0)
    {
        if(c == 0)
        {
            b = 1;
        }
        else
        {
            if(b < 0)
            {
                b *= -1;
                c *= -1;
            }
            gd = gcd(abs(b),abs(c));
        }
    }
    else
    {
        if(b == 0)
        {
            if(c == 0)
            {
                a = 1;
            }
            else
            {
                if(a < 0)
                {
                    a *= -1;
                    c *= -1;
                }
                gd = gcd(abs(a),abs(c));
            }
        }
        else
        {
            if(c == 0)
            {
                if(a < 0)
                {
                    a *= -1;
                    b *= -1;
                }
                gd = gcd(abs(a),abs(b));
            }
            else
            {
                if(a < 0)
                {
                    a *= -1;
                    b *= -1;
                    c *= -1;
                }
                gd = gcd(abs(a),gcd(abs(b),abs(c)));
            }
        }
    }

    //int gd = gcd(abs(a) ? abs(a) : 1,gcd(abs(b) ? abs(b) : 1,abs(c) ? abs(c) : 1));
    a /= gd;
    b /= gd;
    c /= gd;

    return 27000000LL*a + 13000LL * b + c;
}

int main()
{
    int n;
    ll hsh;
    cin>>n;
    int x,y;
    rep(i,0,n-1)
    {
        cin>>x>>y;
        p.pb(mp(x,y));
    }
    ull res = (n * 1LL * (n-1) * (n-2))/6;

    rep(i,0,n-1)
    {
        rep(j,i+1,n-1)
        {
            ll hsh = get_line(p[i],p[j]);
            m[hsh].insert(p[i]);
            m[hsh].insert(p[j]);
        }
    }

    ull rem = 0;
    int siz;

    map<ll,set<ii> >::iterator it;
    tr(m,it)
    {
         siz = sz(it->S);
         rem += (siz * 1LL * (siz-1) * (siz-2))/6;
    }
    res -= rem;
    cout<<res<<endl;
    return 0;
}

/*#include<iostream>
#include<vector>
#include<map>
#include<set>
using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector< pair<double, ii> > vdii;
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for( typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ull long long int

vii p;

map<ii,set<ii > > m;

set<ii> infs;

int main()
{
    int n;
    cin>>n;
    int x,y;
    rep(i,0,n-1)
    {
        cin>>x>>y;
        p.pb(mp(x,y));
    }
    ull res = (1LL * n * (n-1) * (n-2))/6;
    float slope;
    rep(i,0,n-1)
    {
        rep(j,i+1,n-1)
        {
            int dividend = (p[j].second - p[i].second);
            int divisor = (p[j].first - p[i].first);
            if(divisor == 0)
            {
                infs.insert(p[i]);
                infs.insert(p[j]);
                cout<<"nd nd"<<endl;
                continue;
            }
            int q = dividend/divisor;
            int r = abs(dividend)%abs(divisor);
            cout<<q<<" "<<r<<endl;
            ii pr = mp(q,r);
            m[pr].insert(p[i]);
            m[pr].insert(p[j]);
        }
    }

    ull rem = 0;
    int sz;
    cout<<"from map: "<<endl;
    for(map<ii,set<ii> >::iterator it = m.begin(); it != m.end(); it++)
    {
         sz = int((it->second).size());
         cout<<it->first.first<<" "<<it->first.second<<" "<<sz<<endl;
         rem += (1LL * sz*(sz-1)*(sz-2))/6;
    }
    sz = infs.size();
    rem += (1LL * sz*(sz-1)*(sz-2))/6;
    cout<<"nd nd "<<sz<<endl;
    res -= rem;
    cout<<res<<endl;
    return 0;
}*/


#include <cstdio>
#include <algorithm>
#include <iostream>
#define f first
#define s second
using namespace std;

int N,K;

int read()
{
    int t,z,v;
    scanf("%d %d",&N,&K);
    return 0;
}

int f(int x,int y,int lvl)
{
    if(lvl>N) return -(1<<30);
    if(x<y) swap(x,y);
    if(y==0 && x!=1) return -(1<<30);
    if(y==0) {if(N==lvl)return 0; else return -(1<<30);}
    if(y==1) {if(N==lvl+x)return x-2; else return -(1<<30);}
    return f(y,x%y,lvl+(x/y))+(x/y-1);
}

int g(int x,int y)
{
    if(y==1)
    {
        printf("T");
        for(int t=1;t<x;t++)
            printf("B");
        return 0;
    }
    if(x<y) swap(x,y);
    int z=g(y,x%y);
    for(int t=0;t<x/y;t++)
        if(z==0)
            printf("T");
        else printf("B");
    return !z;
}

int main()
{
    int t,z,v,i,j,k;
    read();
    if(K==1 && N==1) {printf("0\nT\n");return 0;}
    for(t=1,z=100000,k=0;t<K;t++)
    {
        v=f(K,t,0);
        if(v>=0 && v<z) z=v,k=t;
    }
    if(z==100000) {printf("IMPOSSIBLE\n");return 0;}
    printf("%d\n",z);
    g(K,k);
    printf("\n");
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <iostream>
#define f first
#define s second
using namespace std;

int N,K;

int read()
{
    int t,z,v;
    scanf("%d %d",&N,&K);
    return 0;
}

int f(int x,int y,int lvl)
{
    if(lvl>N) return -(1<<30);
    if(x<y) swap(x,y);
    if(y==0 && x!=1) return -(1<<30);
    if(y==0) {if(N==lvl)return 0; else return -(1<<30);}
    if(y==1) {if(N==lvl+x)return x-2; else return -(1<<30);}
    return f(y,x%y,lvl+(x/y))+(x/y-1);
}

int g(int x,int y)
{
    if(y==1)
    {
        printf("T");
        for(int t=1;t<x;t++)
            printf("B");
        return 0;
    }
    if(x<y) swap(x,y);
    int z=g(y,x%y);
    for(int t=0;t<x/y;t++)
        if(z==0)
            printf("T");
        else printf("B");
    return !z;
}

int main()
{
    int t,z,v,i,j,k;
    read();
    if(K==1 && N==1) {printf("0\nT\n");return 0;}
    if(K+1==N) {printf("%d\nT",K);for(int t=0;t<K;t++)printf("B");printf("\n");return 0;}
    for(t=1,z=100000,k=0;t<K;t++)
    {
        v=f(K,t,0);
        if(v>=0 && v<z) z=v,k=t;
    }
    if(z==100000) {printf("IMPOSSIBLE\n");return 0;}
    printf("%d\n",z);
    g(K,k);
    printf("\n");
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <iostream>
#define f first
#define s second
using namespace std;

int N,K;

int read()
{
    int t,z,v;
    scanf("%d %d",&N,&K);
    return 0;
}

int f(int x,int y,int lvl)
{
    if(lvl>N) return -(1<<30);
    if(x<y) swap(x,y);
    if(y==0 && x!=1) return -(1<<30);
    if(y==0) {if(N==lvl)return 0; else return -(1<<30);}
    if(y==1) {if(N==lvl+x)return x-2; else return -(1<<30);}
    return f(y,x%y,lvl+(x/y))+(x/y-1);
}

int g(int x,int y)
{
    if(y==1)
    {
        printf("T");
        for(int t=1;t<x;t++)
            printf("B");
        return 0;
    }
    if(x<y) swap(x,y);
    int z=g(y,x%y);
    for(int t=0;t<x/y;t++)
        if(z==0)
            printf("T");
        else printf("B");
    return !z;
}

int main()
{
    int t,z,v,i,j,k;
    read();
    if(K==1 && N==1) {printf("0\nT\n");return 0;}
    if(K+1==N) {printf("%d\nT",K-1);for(int t=0;t<K;t++)printf("B");printf("\n");return 0;}
    for(t=1,z=100000,k=0;t<K;t++)
    {
        v=f(K,t,0);
        if(v>=0 && v<z) z=v,k=t;
    }
    if(z==100000) {printf("IMPOSSIBLE\n");return 0;}
    printf("%d\n",z);
    g(K,k);
    printf("\n");
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <iostream>
#define f first
#define s second
using namespace std;

int N,K;

int read()
{
    int t,z,v;
    scanf("%d %d",&N,&K);
    return 0;
}

int f(int x,int y,int lvl)
{
    if(lvl>N) return -(1<<30);
    if(x<y) swap(x,y);
    if(y==0 && x!=1) return -(1<<30);
    if(y==0) {if(N==lvl)return 0; else return -(1<<30);}
    if(y==1) {if(N==lvl+x)return x-2; else return -(1<<30);}
    return f(y,x%y,lvl+(x/y))+(x/y-1);
}

int g(int x,int y)
{
    if(y==1)
    {
        printf("T");
        for(int t=1;t<x;t++)
            printf("B");
        return 0;
    }
    if(x<y) swap(x,y);
    int z=g(y,x%y);
    for(int t=0;t<x/y;t++)
        if(z==0)
            printf("T");
        else printf("B");
    return !z;
}

int main()
{
    int t,z,v,i,j,k;
    read();
    if(K==1 && N==1) {printf("0\nT\n");return 0;}
    //if(K==N) {printf("%d\nT",K-1);for(int t=0;t<K-1;t++)printf("B");printf("\n");return 0;}
    for(t=1,z=1000002,k=0;t<K;t++)
    {
        v=f(K,t,0);
        if(v>=0 && v<z) z=v,k=t;
    }
    if(z==1000002) {printf("IMPOSSIBLE\n");return 0;}
    printf("%d\n",z);
    g(K,k);
    printf("\n");
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
int n, r, ans1, ans2, a, b, k1, k2;
char q[1000010];
bool flag;
int main()
{
    scanf("%d%d", &n, &r);
    ans2 = n+1;
    if (n == 1) { if (r == 1) printf("0\nT\n"); else printf("IMPOSSIBLE\n"); return 0; }
    for (int i = 1; i <= r-1; ++i)
    {
        a = i; b = r; flag = 1; k1 = k2 = 0;
        do{
            if (a*b == 0) { flag = 0; break; }
            if (a == b) { flag = 0; break; }
            if (a > b)
            {
                if (b == 1) { k1 += a-1; k2 += a-2; a = 1; }
                else { k1 += a/b; k2 += (a/b-1); a%=b; }
            }
            else
            {
                if (a == 1) { k1 += b-1; k2 += b-2; b =1; }
                else { k1 += b/a; k2 += (b/a-1); b%=a; }
            }
            if (k1 > n-1) { flag = 0; break; }
            if (a == 1 && b == 1 && k1 == n-1) break;
        }while (1);
        if (flag) { if (k2 < ans2) { ans2 = k2; ans1 = i; } }
    }
    if (ans2 == n+1) printf("IMPOSSIBLE\n");
    else
    {
        printf("%d\n", ans2);
        a = ans1; b = r;
        for (int i = 1; i <= n-1; ++i)
        {
            if (a > b) { q[n+1-i] = 'T'; a -= b; }
            else { q[n+1-i] = 'B'; b -= a; }
        }
        printf("%c", 'T');
        if (q[2] == 'B') { for (int i = 2; i <= n; ++i) printf("%c", q[i]); }
        else { for (int i = 2; i <= n; ++i) if (q[i] == 'T') printf("%c", 'B'); else printf("%c", 'T'); }
        printf("\n");
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <set>

using namespace std;

int n, r;

int f(int a, int b) {
    int ret = 0;
    int last = -1;
    int cnt = 0;
    while (a != 1 || b != 1) {
        if (a > b) {
            a = a - b;
            if (last == 0) ++ret;
            last = 0;
        } else if (b > a) {
            b = b - a;
            if (last == 1) ++ret;
            last = 1;
        } else return 987654321;
        ++cnt;
    }
    if (last == 0) ++ret;
    if (cnt != n - 1) return 987654321;
    return ret;
}

void g(int a, int b) {
    char res[n + 1];
    int cur = n - 1;
    while (a != 1 || b != 1) {
        if (a > b) {
            a = a - b;
            res[cur] = 'T';
        } else {
            b = b - a;
            res[cur] = 'B';
        }
        --cur;
    }
    res[0] = 'T';
    res[n] = '\0';
    printf("%s\n", res);
}

int main() {
    cin >> n >> r;
    int best = 987654321;
    for (int other = 1; other <= r; ++other) {
        best = min(best, f(other, r));
        best = min(best, f(r, other));
    }
    if (best == 987654321) cout << "IMPOSSIBLE" << endl;
    else {
        cout << best << endl;
        for (int other = 1; other <= r; ++other) {
            if (best == f(other, r)) { g(other, r); break; }
            if (best == f(r, other)) { g(r, other); break; }
        }
    }
    return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#define forn(i,n) for(int i=0;i<(int)n;i++)
using namespace std;
int p1,p2;
vector<pair<int,int> > v;
int gcdlen(int a,int b)
{
	//printf("%d %d\n",a,b);
	if(b==0)
	{
		if(a==1)
			return 0;
		else
			return 1e9;
	}
	int len=a/b;
	p1+=len-1;
	//swap(p1,p2);
	len+=gcdlen(b,a%b);
	return len;
}
int gcdlenx(int a,int b)
{
	v.push_back(make_pair(a,b));
	if(b==0)
	{
		if(a==1)
			return 0;
		else
			return 1e9;
	}
	int len=a/b;
	p1+=len-1;
	//swap(p1,p2);
	len+=gcdlenx(b,a%b);
	return len;
}
int main()
{
	int n,k;
	scanf("%d %d",&k,&n);
	int mini=1e9,ans=-1;
	for(int i=1;i<n;i++)
	{
		p1=p2=0;
		//printf("!!!%d\n",i);
		if(gcdlen(n,i)==k)
		{
			if(mini>p1)
			{

			mini=p1;
			ans=i;
			}
		}
		//p1=0;
		//printf("%d\n",p1);
	}
	if(ans==-1)
	{
		printf("IMPOSSIBLE");
		return 0;
	}
	printf("%d\n",mini-1);
	gcdlenx(n,ans);
	reverse(v.begin(),v.end());
	printf("T");
	forn(i,v[1].first/v[1].second-1)
		printf("B");
	char now='T',next='B';
	forn(j,v.size())
	{
		//printf("%d %d\n",v[j].first,v[j].second);
	}
	forn(j,v.size())
	{
		if(j<=1)continue;
		forn(i,v[j].first/v[j].second)
			printf("%c",now);
	   	swap(now,next);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#define forn(i,n) for(int i=0;i<(int)n;i++)
using namespace std;
int p1,p2;
vector<pair<int,int> > v;
int gcdlen(int a,int b)
{
	//printf("%d %d\n",a,b);
	if(b==0)
	{
		if(a==1)
			return 0;
		else
			return 1e9;
	}
	int len=a/b;
	p1+=len-1;
	//swap(p1,p2);
	len+=gcdlen(b,a%b);
	return len;
}
int gcdlenx(int a,int b)
{
	v.push_back(make_pair(a,b));
	if(b==0)
	{
		if(a==1)
			return 0;
		else
			return 1e9;
	}
	int len=a/b;
	p1+=len-1;
	//swap(p1,p2);
	len+=gcdlenx(b,a%b);
	return len;
}
int main()
{
	int n,k;
	scanf("%d %d",&k,&n);
	int mini=1e9,ans=-1;
	for(int i=1;i<n;i++)
	{
		p1=p2=0;
		//printf("!!!%d\n",i);
		if(gcdlen(n,i)==k)
		{
			if(mini>p1)
			{

			mini=p1;
			ans=i;
			}
		}
		//p1=0;
		//printf("%d\n",p1);
	}
	if(ans==-1)
	{
		printf("IMPOSSIBLE");
	}
	printf("%d\n",mini-1);
	gcdlenx(n,ans);
	reverse(v.begin(),v.end());
	printf("T");
	forn(i,v[1].first/v[1].second-1)
		printf("B");
	char now='T',next='B';
	forn(j,v.size())
	{
		//printf("%d %d\n",v[j].first,v[j].second);
	}
	forn(j,v.size())
	{
		if(j<=1)continue;
		forn(i,v[j].first/v[j].second)
			printf("%c",now);
	   	swap(now,next);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#define forn(i,n) for(int i=0;i<(int)n;i++)
using namespace std;
int p1,p2;
vector<pair<int,int> > v;
int gcdlen(int a,int b)
{
	//printf("%d %d\n",a,b);
	if(b==0)
	{
		if(a==1)
			return 0;
		else
			return 1e9;
	}
	int len=a/b;
	p1+=len-1;
	//swap(p1,p2);
	len+=gcdlen(b,a%b);
	return len;
}
int gcdlenx(int a,int b)
{
	v.push_back(make_pair(a,b));
	if(b==0)
	{
		if(a==1)
			return 0;
		else
			return 1e9;
	}
	int len=a/b;
	p1+=len-1;
	//swap(p1,p2);
	len+=gcdlenx(b,a%b);
	return len;
}
int main()
{
	int n,k;
	scanf("%d %d",&k,&n);
	if(n==1&&k==1)
	{
		printf("0\nT");
		return 0;
	}
	int mini=1e9,ans=-1;
	for(int i=1;i<n;i++)
	{
		p1=p2=0;
		//printf("!!!%d\n",i);
		if(gcdlen(n,i)==k)
		{
			if(mini>p1)
			{

			mini=p1;
			ans=i;
			}
		}
		//p1=0;
		//printf("%d\n",p1);
	}
	if(ans==-1)
	{
		printf("IMPOSSIBLE");
		return 0;
	}
	printf("%d\n",mini-1);
	gcdlenx(n,ans);
	reverse(v.begin(),v.end());
	printf("T");
	forn(i,v[1].first/v[1].second-1)
		printf("B");
	char now='T',next='B';
	forn(j,v.size())
	{
		//printf("%d %d\n",v[j].first,v[j].second);
	}
	forn(j,v.size())
	{
		if(j<=1)continue;
		forn(i,v[j].first/v[j].second)
			printf("%c",now);
	   	swap(now,next);
	}
	return 0;
}


#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;
#define lowbit(x) (x&(-x))
#define Max(a,b) a>b?a:b
#define Min(a,b) a<b?a:b
#define INF 0x7fffffff
#define LLINF 922337203685477600LL
#define LL long long
#define MAXN 21000
#define MAXE 1100000
#define CH 129
#define eps 1e-8
#define PI acos(-1.0)
#define mod 10000
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
#define fuck puts("<<---------------------");
int n;
char str[1100000];
int gao(int x,int y){
    int dif=0;
    int cc=0;
    while(x && y){
        if(x > y){
            dif += (x/y-1);
            cc += x/y;
            x %= y;
        }
        else{
            dif += (y/x-1);
            cc += y/x;
            y %= x;
        }
    }
    //printf("%d~~%d %d %d\n",x,y,n,cc);
    if(x+y == 1 && cc == n) return dif-1;
    else return INF;
}
int main(){
    int i,j,h;
    int T,m;
    int cas=1;
    int r;
    while(scanf("%d%d",&n,&r)!=EOF){
        if(n==1&&r==1){
            puts("0\nT");
            continue;
        }
        int ans=INF;
        int idx;
        for(i=1;i<=r;i++){
            int res=gao(i,r);
            if(res<ans){
                ans=res; idx=i;
            }
        }
        if(ans==INF){
            puts("IMPOSSIBLE");
            continue;
        }
        int x=r,y=idx;
        printf("%d\n",ans);
        for(i=n; i>=1; i--){
            if(x > y){
                x -= y; str[i-1]='T';
            }
            else {
                y -= x; str[i-1]='B';
            }
        }
        if(str[1]=='T'){
            x=idx; y=r;
            for(i=n; i>=1; i--){
                if(x > y){
                    x -= y; str[i-1]='T';
                }
                else {
                    y -= x; str[i-1]='B';
                }
            }
        }
        str[0]='T';
        str[n]='\0';
        puts(str);
    }
    return 0;
}


#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;
#define lowbit(x) (x&(-x))
#define Max(a,b) a>b?a:b
#define Min(a,b) a<b?a:b
#define INF 0x7fffffff
#define LLINF 922337203685477600LL
#define LL long long
#define MAXN 21000
#define MAXE 1100000
#define CH 129
#define eps 1e-8
#define PI acos(-1.0)
#define mod 10000
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
#define fuck puts("<<---------------------");
int n;
char str[1100000];
int gao(int x,int y){
    int dif=0;
    int cc=0;
    while(x && y){
        if(x > y){
            dif += (x/y-1);
            cc += x/y;
            x %= y;
        }
        else{
            dif += (y/x-1);
            cc += y/x;
            y %= x;
        }
    }
    //printf("%d~~%d %d %d\n",x,y,n,cc);
    if(x+y == 1 && cc == n) return dif-1;
    else return INF;
}
int main(){
    int i,j,h;
    int T,m;
    int cas=1;
    int r;
    while(scanf("%d%d",&n,&r)!=EOF){
        int ans=INF;
        int idx;
        for(i=1;i<=r;i++){
            int res=gao(i,r);
            if(res<ans){
                ans=res; idx=i;
            }
        }
        if(ans==INF){
            puts("IMPOSSIBLE");
            continue;
        }
        int x=r,y=idx;
        printf("%d\n",ans);
        for(i=n; i>=1; i--){
            if(x > y){
                x -= y; str[i-1]='T';
            }
            else {
                y -= x; str[i-1]='B';
            }
        }
        if(str[1]=='T'){
            x=idx; y=r;
            for(i=n; i>=1; i--){
                if(x > y){
                    x -= y; str[i-1]='T';
                }
                else {
                    y -= x; str[i-1]='B';
                }
            }
        }
        str[0]='T';
        str[n]='\0';
        puts(str);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int n, r;
int ans, c;
char q[10000000], q2[10000000];

void check(int a, int b) {
    c = 0;
    while (c < n - 1 && a > 0 && b > 0) {
        if (a > b) {
            a -= b;
            q[c++] = 'T';
        } else {
            b -= a;
            q[c++] = 'B';
        }
    }
	q[c++] = 'T';
    if (a == 1 && b == 1) {
        int cnt = 0;
        for (int i = 0; i < c - 1; ++i) {
            if (q[i] == q[i + 1]) {
                ++cnt;
            }
        }
		if (cnt < ans) {
			ans = cnt;
            for (int i = 0; i < n; ++i) {
                q2[i] = q[i];
            }
		}
    }
}

int main() {
    //freopen("in.txt", "r", stdin);

    scanf("%d%d", &n, &r);
    if (n == 1 && r == 1) {
        cout << 0 << endl << 'T';
        return 0;
    }
    ans = 1 << 29;
    for (int i = 1; i <= r; ++i) {
        check(i, r);
        check(r, i);
    }
    if (ans == (1 << 29)) {
        puts("IMPOSSIBLE");
    } else {
        printf("%d\n", ans);
        for (int i = n - 1; i >= 0; --i) {
            printf("%c", q2[i]);
        }
    }
}


#include <iostream>
#include <cstdio>

using namespace std;

int n, r;
int ans, c, c2;
char q[10000000], q2[10000000];

void check(int a, int b) {
    c = 1;
    while (a > 0 && b > 0 && a != b) {
        if (a > b) {
            a -= b;
            q[c++] = 'T';
        } else {
            b -= a;
            q[c++] = 'B';
        }
    }
    q[0] = q[1] == 'T' ? 'B' : 'T';
	q[c++] = 'T';
    if (a == 1 && b == 1) {
        int cnt = 0;
        for (int i = 0; i < c - 1; ++i) {
            if (q[i] == q[i + 1]) {
                ++cnt;
            }
        }
		if (cnt < ans) {
			ans = cnt;
			c2 = c;
			for (int i = 0; i < c2; ++i) {
				q2[i] = q[i];
			}
		}
    }
}

int main() {
    //freopen("in.txt", "r", stdin);
    cin >> n >> r;
    if (n == 1 && r == 1) {
        cout << 1 << endl << 'T';
        return 0;
    }
    ans = 1 << 29;
    for (int i = 1; i < r; ++i) {
        check(i, r - i);
        check(r - i, i);
    }
    if (ans == (1 << 29)) {
        cout << "IMPOSSIBLE";
    } else {
        cout << ans << endl;
        for (int i = c2 - 1; i >= 0; --i) {
            cout << q2[i];
        }
    }
}


#include <iostream>
#include <cstdio>

using namespace std;

int n, r;
int ans, c;
char q[10000000], q2[10000000];

void check(int a, int b) {
    c = 1;
    while (c < n - 1) {
        if (a > b) {
            a -= b;
            q[c++] = 'T';
        } else {
            b -= a;
            q[c++] = 'B';
        }
    }
    q[0] = q[1] == 'T' ? 'B' : 'T';
	q[c++] = 'T';
    if (a == 1 && b == 1) {
        int cnt = 0;
        for (int i = 0; i < c - 1; ++i) {
            if (q[i] == q[i + 1]) {
                ++cnt;
            }
        }
		if (cnt < ans) {
			ans = cnt;
			for (int i = 0; i < n; ++i) {
				q2[i] = q[i];
			}
		}
    }
}

int main() {
    cin >> n >> r;
    if (n == 1 && r == 1) {
        cout << 1 << endl << 'T';
        return 0;
    }
    ans = 1 << 29;
    for (int i = 1; i < r; ++i) {
        check(i, r - i);
        check(r - i, i);
    }
    if (ans == (1 << 29)) {
        cout << "IMPOSSIBLE";
    } else {
        cout << ans << endl;
        for (int i = n - 1; i >= 0; --i) {
            cout << q2[i];
        }
    }
}


#include <iostream>

using namespace std;

int n, r;
int ans, c, c2;
char q[10000000], q2[10000000];

void check(int a, int b) {
    c = 0;
	q[c++] = 'B';
    while (a > 0 && b > 0 && a != b) {
        if (a > b) {
            a -= b;
            q[c++] = 'T';
        } else {
            b -= a;
            q[c++] = 'B';
        }
    }
	q[c++] = 'T';
    if (a == 1 && b == 1) {
        int cnt = 0;
        for (int i = 0; i < c - 1; ++i) {
            if (q[i] == q[i + 1]) {
                ++cnt;
            }
        }
		if (cnt < ans) {
			ans = cnt;
			c2 = c;
			for (int i = 0; i < c2; ++i) {
				q2[i] = q[i];
			}
		}
    }
}

int main() {
	//freopen("in.txt", "r", stdin);
    cin >> n >> r;
    ans = 1 << 29;
    for (int i = 1; i < r; ++i) {
        check(i, r - i);
        check(r - i, i);
    }
    if (ans == (1 << 29)) {
        cout << "IMPOSSIBLE";
    } else {
        cout << ans << endl;
        for (int i = c2 - 1; i >= 0; --i) {
            cout << q2[i];
        }
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int n, r;
int ans, c;
char q[10000000], q2[10000000];

void check(int a, int b) {
    c = 0;
    while (c < n - 1 && a > 0 && b > 0) {
        if (a > b) {
            a -= b;
            q[c++] = 'T';
        } else {
            b -= a;
            q[c++] = 'B';
        }
    }
	q[c++] = 'T';
    if (a == 1 && b == 1) {
        int cnt = 0;
        for (int i = 0; i < c - 1; ++i) {
            if (q[i] == q[i + 1]) {
                ++cnt;
            }
        }
		if (cnt < ans) {
			ans = cnt;
            for (int i = 0; i < n; ++i) {
                q2[i] = q[i];
            }
		}
    }
}

int main() {
    //freopen("in.txt", "r", stdin);

    scanf("%d%d", &n, &r);
    if (n == 1 && r == 1) {
        cout << 1 << endl << 'T';
        return 0;
    }
    ans = 1 << 29;
    for (int i = 1; i <= r; ++i) {
        check(i, r);
        check(r, i);
    }
    if (ans == (1 << 29)) {
        puts("IMPOSSIBLE");
    } else {
        printf("%d\n", ans);
        for (int i = n - 1; i >= 0; --i) {
            printf("%c", q2[i]);
        }
    }
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
const int Maxn=1000000+2;
int n,r;
char move[Maxn],ans[Maxn];
int check(int x,int y)
{
    int i,ret=0;
    for(i=n;i>=1&&x*y!=0;--i)
    {
        if(x>=y)x-=y,move[i]='T';
        else y-=x,move[i]='B';
    }
    if(i!=0||!(x==0&&y==1))return -1;
    for(int i=2;i<=n;++i)
        if(move[i]==move[i-1])ret++;
    return ret;
}
void update()
{
    for(int i=1;i<=n;++i)ans[i]=move[i];
}
int main()
{
  //  freopen("in.txt","r",stdin);
    scanf("%d%d",&n,&r);
    int ret=Maxn;
    for(int i=1;i<=r;++i)
    {
        int tmp=check(i,r);
        if(tmp!=-1&&ret>tmp)
        {
            ret=tmp;
            update();
        }
        tmp=check(r,i);
        if(tmp!=-1&&ret>tmp)
        {
            ret=tmp;
            update();
        }
    }
    if(ret==Maxn)cout<<"IMPOSSIBLE"<<endl;
    else
    {
        cout<<ret<<endl;
        for(int i=1;i<=n;++i)
        printf("%c",ans[i]);
        printf("\n");
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;

int n, r;
char ans[1000002];
char ans1[1000002];

bool solve(int a, int b, int k)
{
    if (k > 2)
    {
        if (a > b)
        {
            if (solve(a - b, b, k - 1))
            {
                ans[k - 1] = 'T';
                return true;
            }
        }
        if (a < b)
        {
            if(solve(a, b - a, k - 1))
            {
                ans[k - 1] = 'B';
                return true;
            }
        }
        return false;
    }
    if (k == 2 && a == 1 && b == 1 || k == 1 && a == 1 && b == 0) return true;
    else return false;
}

int main ()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> r;
    ans[1] = ans1[1] = 'T';
    bool res = false;
    int err1 = n + 1;
    if (n == 1 && r == 1)
    {
        res = true;
        err1 = 0;
    }
    int err = 0;
    for (int i = 1; i < r; i++)
    {
        if (solve(i, r - i, n))
        {
            res = true;
            ans[n] = (ans[n - 1] == 'T' ? 'B' : 'T');
            if (ans[2] == 'T')
            {
                for (int j = 1; j < n; j++)
                {
                    if (ans[j + 1] == 'T') ans[j + 1] = 'B';
                    else ans[j + 1] = 'T';
                }
            }
            for (int j = 1; j < n; j++)
                if (ans[j] == ans[j + 1]) err++;
            if (err < err1)
            {
                err1 = err;
                for (int j = 0; j < n; j++)
                    ans1[j + 1] = ans[j + 1];
            }
            err = 0;
        }
    }
    if (!res) cout << "IMPOSSIBLE";
    else
    {
        cout << err1 << endl;
        for (int i = 0; i < n; i++)
            cout << ans1[i + 1];
    }
    return 0;
}


#include <iostream>
using namespace std;
int bol[1000001];
char a[1000001];
char b[1000001];
int c[1000001];
int ok,n,m;
int M;
int l;
int mt(int ,int);
int main()
{
    int i=0,j,t;
    int fs=0,fe=1;
    int MIN=1000001;
    while(fe<=1000000)
    {
         t=fe;
         fe=fs+fe;
         fs=t;
         bol[i++]=fe;
    }
    cin>>n>>m;
    n--;
    l=n;
    for(i=m-1;i>=m/2;i--)
    {
       n=l;
       ok=M=0;
        mt(m,i);
       if(ok&&M<MIN)
       {
         for(j=0;j<=l;j++)
          b[j]=a[j];
         MIN=M;
       }
    }
    if(b[0]!='\0')
    {
       cout<<MIN<<endl;
       for(i=0;i<=l;i++)
          cout<<b[i];
    }
    else
       cout<<"IMPOSSIBLE";
   cout<<endl;
   return 0;
}
int mt(int end,int start)
{
    int i;
    if(end==start)
      return 0;
    if(end<start)
     {
       int t=start;
       start=end;
       end=t;
       M++;
       c[n]=1;
     }
    else
       c[n]=0;
    if(bol[n]==end&&bol[n-1]==start)
    {
      for(i=0;i<=n;i++)
        if(i%2)
          a[i]='B';
        else
          a[i]='T';
      for(;i<=l;i++)
      {
         if(c[i-1])
           a[i]=a[i-1];
         else
         {
            if(a[i-1]=='T')
              a[i]='B';
            else
              a[i]='T';
         }
      }
      ok=1;
      return 0;
    }
    if(n==1)
     return 0;
    n--;
    int t=start;
    start=end-t;
    end=t;
    mt(end,start);
    return 0;
}


#include <iostream>
using namespace std;
int bol[1000001];
char a[1000001];
char b[1000001];
int ok,n,m;
int M;
int mt(int ,int);
int main()
{
    int i=0,j,t;
    int fs=0,fe=1;
    int MIN=1000001;
    while(fe<=1000000)
    {
         t=fe;
         fe=fs+fe;
         fs=t;
         bol[i++]=fe;
    }
    cin>>n>>m;
    n--;
    if((n+1)%2)
       a[n+1]='B';
    else
       a[n+1]='T';
    int l=n;
    for(i=m-1;i>0;i--)
    {
       n=l;
       ok=M=0;
        mt(m,i);
       if(ok&&M<MIN)
       {
         for(j=0;j<=l;j++)
          b[j]=a[j];
         MIN=M;
       }
    }
    if(b[0]!='\0')
    {
       cout<<MIN<<endl;
       for(i=0;i<=l;i++)
          cout<<b[i];
    }
    else
       cout<<"IMPOSSIBLE";
   cout<<endl;
   return 0;
}
int mt(int end,int start)
{
    int i;
    if(end==start)
      return 0;
    if(end<start)
     {
       a[n]=a[n+1];
       int t=start;
       start=end;
       end=t;
       M++;
     }
    else
    {
         if(a[n+1]=='T')
           a[n]='B';
         else
           a[n]='T';
    }
    if(bol[n]==end&&bol[n-1]==start)
    {
      for(i=0;i<n;i++)
        if(i%2)
          a[i]='B';
        else
          a[i]='T';
      ok=1;
      return 0;
    }
    if(n==1)
     return 0;
    n--;
    int t=start;
    start=end-t;
    end=t;
    mt(end,start);
    return 0;
}


#include <iostream>
using namespace std;
int bol[1000001];
char a[1000001];
char b[1000001];
int ok,n,m;
int mt(int ,int);
int main()
{
    int i=0,j,t;
    int fs=0,fe=1;
    int MIN=1000001;
    while(fe<=1000000)
    {
         t=fe;
         fe=fs+fe;
         fs=t;
         bol[i++]=fe;
    }
    cin>>n>>m;
    n--;
    if((n+1)%2)
       a[n+1]='B';
    else
       a[n+1]='T';
    int l=n;
    for(i=bol[n-1];i>m/2;i--)
    {
       int min=0;
       n=l;
       ok=0;
       if(m>i)
        mt(m,i);
       if(ok)
       {
       for(j=0;j<=l;j++)
         if(j%2)
         {
            if(a[j]!='B')
              min++;
         }
         else
         {
            if(a[j]!='T')
              min++;
         }
       if(min<MIN)
       {
         for(j=0;j<=l;j++)
          b[j]=a[j];
         MIN=min;
       }
       }
    }
    if(b[0]!='\0')
    {
       cout<<MIN<<endl;
       for(i=0;i<=l;i++)
          cout<<b[i];
    }
    else
       cout<<"IMPOSSIBLE";
   cout<<endl;
   while(1)
   {}
   return 0;
}
int mt(int end,int start)
{
    int i;
    if(end==start)
      return 0;
    if(end<start)
     {
       a[n]=a[n+1];
       int t=start;
       start=end;
       end=t;
     }
    else
    {
         if(a[n+1]=='T')
           a[n]='B';
         else
           a[n]='T';
    }
    if(bol[n]==end&&bol[n-1]==start)
    {
      for(i=0;i<n;i++)
        if(i%2)
          a[i]='B';
        else
          a[i]='T';
      ok=1;
      return 0;
    }
    if(n==1)
     return 0;
    n--;
    int t=start;
    start=end-t;
    end=t;
    mt(end,start);
    return 0;
}


#include <iostream>
using namespace std;
int bol[1000001];
char a[1000001];
char b[1000001];
int ok,n,m;
int M;
int l;
int mt(int ,int);
int main()
{
    int i=0,j,t;
    int fs=0,fe=1;
    int MIN=1000001;
    while(fe<=1000000)
    {
         t=fe;
         fe=fs+fe;
         fs=t;
         bol[i++]=fe;
    }
    cin>>n>>m;
    n--;
    a[n+1]='B';
    l=n;
    for(i=m-1;i>0;i--)
    {
       n=l;
       ok=M=0;
        mt(m,i);
       if(ok&&M<MIN)
       {
         for(j=0;j<=l;j++)
          b[j]=a[j];
         MIN=M;
       }
    }
    if(b[0]!='\0')
    {
       cout<<MIN<<endl;
       for(i=0;i<=l;i++)
          cout<<b[i];
    }
    else
       cout<<"IMPOSSIBLE";
   cout<<endl;
   return 0;
}
int mt(int end,int start)
{
    int i;
    if(end==start)
      return 0;
    if(end<start)
     {
       a[n]=a[n+1];
       int t=start;
       start=end;
       end=t;
       M++;
     }
    else
    {
         if(a[n+1]=='T')
           a[n]='B';
         else
           a[n]='T';
    }
    if(bol[n]==end&&bol[n-1]==start)
    {
      for(i=0;i<n;i++)
        if(i%2)
          a[i]='B';
        else
          a[i]='T';
      if(a[n]==a[n-1])
      {
         for(i=n;i<=l;i++)
         {
            if(a[i]=='B')
              a[i]='T';
            else
              a[i]='B';
         }
      }
      ok=1;
      return 0;
    }
    if(n==1)
     return 0;
    n--;
    int t=start;
    start=end-t;
    end=t;
    mt(end,start);
    return 0;
}


#include <iostream>
using namespace std;
int bol[1000001];
char a[1000001];
char b[1000001];
int ok,n,m;
int M;
int mt(int ,int);
int main()
{
    int i=0,j,t;
    int fs=0,fe=1;
    int MIN=1000001;
    while(fe<=1000000)
    {
         t=fe;
         fe=fs+fe;
         fs=t;
         bol[i++]=fe;
    }
    cin>>n>>m;
    n--;
    if((n+1)%2)
       a[n+1]='B';
    else
       a[n+1]='T';
    int l=n;
    for(i=bol[n-1];i>m/2;i--)
    {
       n=l;
       ok=M=0;
       if(m>i)
        mt(m,i);
       if(ok&&M<MIN)
       {
         for(j=0;j<=l;j++)
          b[j]=a[j];
         MIN=M;
       }
    }
    if(b[0]!='\0')
    {
       cout<<MIN<<endl;
       for(i=0;i<=l;i++)
          cout<<b[i];
    }
    else
       cout<<"IMPOSSIBLE";
   cout<<endl;
   return 0;
}
int mt(int end,int start)
{
    int i;
    if(end==start)
      return 0;
    if(end<start)
     {
       a[n]=a[n+1];
       int t=start;
       start=end;
       end=t;
       M++;
     }
    else
    {
         if(a[n+1]=='T')
           a[n]='B';
         else
           a[n]='T';
    }
    if(bol[n]==end&&bol[n-1]==start)
    {
      for(i=0;i<n;i++)
        if(i%2)
          a[i]='B';
        else
          a[i]='T';
      ok=1;
      return 0;
    }
    if(n==1)
     return 0;
    n--;
    int t=start;
    start=end-t;
    end=t;
    mt(end,start);
    return 0;
}