#include <iostream>
using namespace std;
int main()
{
    long long int n,x,c=0,d;
    char h;
    cin>>n>>x;
    for(int i=0;i<n;i++)
    {
        cin>>h>>d;
        if(h=='+')
        x+=d;
        else
        {
            if(x>=d)
            {
                x-=d;
            }
            else
            c++;
        }
    }

    cout<<x<<" "<<c<<endl;
    return 0;
}


#include<cstdio>
#include <cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include <map>
using namespace std;
const int N = 200000;
# define PI 3.141592657
struct node{
	 int x;
	 int y;
}b[N];

bool cmp(struct node a,struct node b){
	if(a.x < b.x)
    {
        return true;
    }
    return false;
}

int main()
{
	long long int n, x;
	while (cin >> n >> x)
	{
		long long int ans = x;
		int temp = 0;
		for (int i = 0; i < n; i++)
		{
			char b;
		    long long int a;
			cin >> b >> a;
			if (b == '+')
			{
				ans += a;
			}else
			{
				if (ans > a)
				{
					ans -= a;
				}else
				{
					temp ++;
				}
			}
		}
		cout << ans <<" "<< temp << endl;
	}
   return 0;
}


#include<cstdio>
#include <cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include <map>
using namespace std;
const int N = 200000;
# define PI 3.141592657
struct node{
	 int x;
	 int y;
}b[N];

bool cmp(struct node a,struct node b){
	if(a.x < b.x)
    {
        return true;
    }
    return false;
}

int main()
{
	long long int n, x;
	while (cin >> n >> x)
	{
		int ans = x;
		int temp = 0;
		for (int i = 0; i < n; i++)
		{
			char b;
		    long long int a;
			cin >> b >> a;
			if (b == '+')
			{
				ans += a;
			}else
			{
				if (ans > a)
				{
					ans -= a;
				}else
				{
					temp ++;
				}
			}
		}
		cout << ans <<" "<< temp << endl;
	}
   return 0;
}


#include<cstdio>
#include <cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include <map>
using namespace std;
const int N = 200000;
# define PI 3.141592657
struct node{
	 int x;
	 int y;
}b[N];

bool cmp(struct node a,struct node b){
	if(a.x < b.x)
    {
        return true;
    }
    return false;
}

int main()
{
	long long int n, x;
	while (cin >> n >> x)
	{
		long long int ans = x;
		int temp = 0;
		for (int i = 0; i < n; i++)
		{
			char b;
		    long long int a;
			cin >> b >> a;
			if (b == '+')
			{
				ans += a;
			}else
			{
				if (ans >= a)
				{
					ans -= a;
				}else
				{
					temp ++;
				}
			}
		}
		cout << ans <<" "<< temp << endl;
	}
   return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,dc=0;
	char exp;
	long long int x;
	cin>>n>>x;
	long long int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>exp>>a[i];
		if(exp == '+')
		{
			x = x+a[i];
		}
		else
		if(exp == '-')
		{
			if(x>=a[i])
			{
				x=x-a[i];
			}
			else
			{
				dc++;
			}
		}
	}
	cout<<x<<" "<<dc<<endl;

}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,dc=0;
	char exp;
	long long int x;
	cin>>n>>x;
	long long int a[1000];
	for(int i=0;i<n;i++)
	{
		cin>>exp>>a[i];
		if(exp == '+')
		{
			x = x+a[i];
		}
		else
		if(exp == '-')
		{
			if(x>=a[i])
			{
				x=x-a[i];
			}
			else
			{
				dc++;
			}
		}
	}
	cout<<x<<" "<<dc<<endl;

}


#include<iostream>
using namespace std;
int main()
{
	int n,dc=0;
	char exp;
	long long int x,a[INT_MAX];
	cin>>n>>x;
	for(int i=0;i<n;i++)
	{
		cin>>exp>>a[i];
		if(exp == '+')
		{
			x = x+a[i];
		}
		else
		if(exp == '-')
		{
			if(x>=a[i])
			{
				x=x-a[i];
			}
			else
			{
				dc++;
			}
		}
	}
	cout<<x<<" "<<dc<<endl;

}


#include<iostream>
using namespace std;
int main()
{
	int n,dc=0;
	char exp;
	long long int x;
	cin>>n>>x;
	long long int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>exp>>a[i];
		if(exp == '+')
		{
			x = x+a[i];
		}
		else
		if(exp == '-')
		{
			if(x>=a[i])
			{
				x=x-a[i];
			}
			else
			{
				dc++;
			}
		}
	}
	cout<<x<<" "<<dc<<endl;

}


# include <iostream>
# include <string>
# include <algorithm>
# include <string.h>
# include <cmath>
# include <fstream>
# include <cstring>
# include <vector>
# include <map>
# include <stdio.h>
# include <cstdio>
# include <sstream>
# include <utility>
# include <iterator>
using namespace std;

//vector<string> Explode(string s, char delimeter)
//{
//	vector<string> result;
//	istringstream iss(s);
//	string token;
//	while (getline(iss, token, delimeter))
//	{
//		result.push_back(token);
//	}
//
//	return result;
//}

int main()
{
	//fstream file("in.txt",ios::in | ios::out);

	char a;
	int sum,n,x,dismiss=0,val;

	cin>>n>>x;
	sum=x;
	for (int i = 0;i < n;i++)
	{
		cin>>a>>val;
		if(a=='+')
			sum+=val;
		else if(a == '-'&& sum>=val)
			sum-=val;
		else
			dismiss++;
	}

	cout<<sum<<" "<<dismiss<<endl;

	return 0;
}


# include <iostream>
# include <string>
# include <algorithm>
# include <string.h>
# include <cmath>
# include <fstream>
# include <cstring>
# include <vector>
# include <map>
# include <stdio.h>
# include <cstdio>
# include <sstream>
# include <utility>
# include <iterator>
using namespace std;

//vector<string> Explode(string s, char delimeter)
//{
//	vector<string> result;
//	istringstream iss(s);
//	string token;
//	while (getline(iss, token, delimeter))
//	{
//		result.push_back(token);
//	}
//
//	return result;
//}

int main()
{
	//fstream file("in.txt",ios::in | ios::out);

	char a;
	long long n, x, dismiss = 0, val;

	cin >> n >> x;
	for (int i = 0;i < n;i++)
	{
		cin>> a >> val;
		if (a == '+')
			x += val;
		else if (a == '-'&& x >= val)
			x -= val;
		else if (a == '-' && x < val)
			dismiss++;
	}

	cout << x << " " << dismiss << endl;

	//system("Pause");
	return 0;
}


# include <iostream>
# include <string>
# include <algorithm>
# include <string.h>
# include <cmath>
# include <fstream>
# include <cstring>
# include <vector>
# include <map>
# include <stdio.h>
# include <cstdio>
# include <sstream>
# include <utility>
# include <iterator>
using namespace std;

//vector<string> Explode(string s, char delimeter)
//{
//	vector<string> result;
//	istringstream iss(s);
//	string token;
//	while (getline(iss, token, delimeter))
//	{
//		result.push_back(token);
//	}
//
//	return result;
//}

int main()
{
	//fstream file("in.txt",ios::in | ios::out);

	char a;
	int n, x, dismiss = 0, val;

	cin >> n >> x;
	for (int i = 0;i < n;i++)
	{
		cin>> a >> val;
		if (a == '+')
			x += val;
		else if (a == '-'&& x >= val)
			x -= val;
		else if (a == '-' && x < val)
			dismiss++;
	}

	cout << x << " " << dismiss << endl;

	//system("Pause");
	return 0;
}


# include <iostream>
# include <string>
# include <algorithm>
# include <string.h>
# include <cmath>
# include <fstream>
# include <cstring>
# include <vector>
# include <map>
# include <stdio.h>
# include <cstdio>
# include <sstream>
# include <utility>
# include <iterator>
using namespace std;

//vector<string> Explode(string s, char delimeter)
//{
//	vector<string> result;
//	istringstream iss(s);
//	string token;
//	while (getline(iss, token, delimeter))
//	{
//		result.push_back(token);
//	}
//
//	return result;
//}

int main()
{
	//fstream file("in.txt",ios::in | ios::out);

	char a;
	int sum,n,x,dismiss=0,val;

	cin>>n>>x;
	sum=x;
	for (int i = 0;i < n;i++)
	{
		cin>>a>>val;
		if(a=='+')
			sum+=val;
		else if(a == '-'&& sum>=val)
			sum-=val;
		else
			dismiss++;
	}

	cout<<sum<<" "<<dismiss<<endl;

	system("Pause");
	return 0;
}


#include <iostream>
using namespace std;
int main() {
	long long n1;char c;int num=0;
	int n,x; cin>>n>>x;
	for(int i=0;i<n;i++)
	{
		cin>>c;cin>>n1;
		if(c=='+')
		x+=n1;
		else
		if(n1<=x)
		x-=n1;
		else
		num++;
	}
	cout<<x<<" "<<num<<endl;
return 0;
}


#include <iostream>
using namespace std;
int main() {
	long long n1;char c;logn logn num=0;
	long long  n,x; cin>>n>>x;
	for(int i=0;i<n;i++)
	{
		cin>>c;cin>>n1;
		if(c=='+')
		x+=n1;
		else
		if(n1<=x)
		x-=n1;
		else
		num++;
	}
	cout<<x<<" "<<num<<endl;
return 0;
}


#include <iostream>
using namespace std;
int main() {
	long long n1;char c;long long num=0;
	long long  n,x; cin>>n>>x;
	for(int i=0;i<n;i++)
	{
		cin>>c;cin>>n1;
		if(c=='+')
		x+=n1;
		else
		if(n1<=x)
		x-=n1;
		else
		num++;
	}
	cout<<x<<" "<<num<<endl;
return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>

typedef unsigned long long ull;

using namespace std;

int main(){

    //Free Ice Cream

    int i, n, x, di, distressed;
    ull left;
    char sign;

    cin>>n>>x;

    left=x;
    distressed=0;

    for (i=1;i<=n;i++){
        cin>>sign>>di;
        if (sign=='+'){
            left+=di;
        }
        else {
            if (left>=di){
                left-=di;
            }
            else {
                distressed++;
            }
        }
    }

    cout<<left<<" "<<distressed<<'\n';

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

int main(){

    //Free Ice Cream

    int i, n, x, di, distressed;
    unsigned long left;
    char sign;

    cin>>n>>x;

    left=x;
    distressed=0;

    for (i=1;i<=n;i++){
        cin>>sign>>di;
        if (sign=='+'){
            left+=di;
        }
        else {
            if (left>=di){
                left-=di;
            }
            else {
                distressed++;
            }
        }
    }

    cout<<left<<" "<<distressed<<'\n';

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

int main(){

    //Free Ice Cream

    int i, n, x, di, left, distressed;
    char sign;

    cin>>n>>x;

    left=x;
    distressed=0;

    for (i=1;i<=n;i++){
        cin>>sign>>di;
        if (sign=='+'){
            left+=di;
        }
        else {
            if (left>=di){
                left-=di;
            }
            else {
                distressed++;
            }
        }
    }

    cout<<left<<" "<<distressed<<'\n';

    return 0;
}


#include <iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<string>
using namespace std ;
int main()
{
	int num,sum;
	cin>>num>>sum;
	char sign;
	int count=0,amount;
	while (num--)
	{
		cin>>sign>>amount;
		if (sign=='-')
		{
			if (amount>sum)
			{
				count++;
			}
			else
				sum-=amount;
		}
		else
			sum+=amount;
	}
	cout<<sum<<" "<<count<<endl;
	return 0;
}


#include <iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<string>
using namespace std ;
int main()
{
	int num;
	long long sum;
	cin>>num>>sum;
	char sign;
	int count=0,amount;
	while (num--)
	{
		cin>>sign>>amount;
		if (sign=='-')
		{
			if (amount>sum)
			{
				count++;
			}
			else
				sum-=amount;
		}
		else
			sum+=amount;
		cout<<sum<<endl;
	}
	cout<<sum<<" "<<count<<endl;
	return 0;
}


#include <iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<string>
using namespace std ;
int main()
{
	int num;
	long long sum;
	cin>>num>>sum;
	char sign;
	int count=0,amount;
	while (num--)
	{
		cin>>sign>>amount;
		if (sign=='-')
		{
			if (amount>sum)
			{
				count++;
			}
			else
				sum-=amount;
		}
		else
			sum+=amount;
	}
	cout<<sum<<" "<<count<<endl;
	return 0;
}


#include<iostream>
#include<string>

using namespace std;
int main()
{
	long long int n,x;
	cin>>n>>x;
	int kids= 0;
	for(int i = 0; i<n; i++){
		char op;
		int packs;
		cin>>op>>packs;
		if( op =='+'){
			x+=packs;
		}else if(op == '-'){
			if(x < packs){
				kids++;
			}else{
				x-= packs;
			}
		}

	}
	cout<<x<<" "<<kids;
}


#include<iostream>
#include<string>

using namespace std;
int main()
{
	double n,x;
	cin>>n>>x;
	int kids= 0;
	for(int i = 0; i<n; i++){
		char op;
		int packs;
		cin>>op>>packs;
		if( op =='+'){
			x+=packs;
		}else if(op == '-'){
			if(x < packs){
				kids++;
			}else{
				x-= packs;
			}
		}

	}
	cout<<x<<" "<<kids;
}


#include<iostream>
#include<string>

using namespace std;
int main()
{
	int n,x;
	cin>>n>>x;
	int kids= 0;
	for(int i = 0; i<n; i++){
		char op;
		int packs;
		cin>>op>>packs;
		if( op =='+'){
			x+=packs;
		}else if(op == '-'){
			if(x < packs){
				kids++;
			}else{
				x-= packs;
			}
		}

	}
	cout<<x<<" "<<kids;
}


#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <sstream>

using namespace std;

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

int main()
{
	long long t, n, ice, d = 0;
	char c;

	cin >> n >> ice;

	for (int i = 0; i <n; ++i)
	{
		cin >> c >> t;
		if (c == '+')
		{
			ice += t;
		}
		else
		{
			if (t > ice)
			{
				d++;
			}
			else
			{
				ice -= t;
			}
		}
	}

	cout << ice << " " << d;

	return 0;
}


#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <sstream>

using namespace std;

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

int main()
{
	long long t, n, ice, d = 0;
	char c;

	cin >> n >> ice;

	for (int i = 0; i < n; ++i)
	{
		cin >> c >> t;
		if (c == '+')
		{
			ice += t;
		}
		else
		{
			if (t > ice)
			{
				d++;
			}
			else
			{
				ice -= t;
			}
		}
	}

	cout << ice << " " << d;

	return 0;
}


#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <sstream>

using namespace std;

int main()
{
	int t, n, ice, d = 0;
	char c;

	cin >> n >> ice;

	for (int i = 0; i < n; ++i)
	{
		cin >> c >> t;
		if (c == '+')
		{
			ice += t;
		}
		else
		{
			if (t > ice)
			{
				d++;
			}
			else
			{
				ice -= t;
			}
		}
	}

	cout << ice << " " << d;

	return 0;
}


#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <sstream>

using namespace std;

int main()
{
	long long t, n, ice, d = 0;
	char c;

	cin >> n >> ice;

	for (int i = 0; i < n; ++i)
	{
		cin >> c >> t;
		if (c == '+')
		{
			ice += t;
		}
		else
		{
			if (t > ice)
			{
				d++;
			}
			else
			{
				ice -= t;
			}
		}
	}

	cout << ice << " " << d;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
pair<pair<int, int>, pair<int, int>> make(vector<pair<int, int>> &v, int i, int j){
	int nm = v[i].second - v[j].second;
	int dm = v[i].first - v[j].first;
	int g = gcd(nm, dm);
	if(g != 0){
	nm /= g;
	dm /= g;
	}
	if(dm == 0){
		nm == 1;
	}
	pair<int, int> m = {nm, dm};

	int nq = v[i].first * v[j].second - v[j].first*v[i].second;
	int dq = v[i].first - v[j].first;
	g = gcd(nq, dq);
	if(g != 0){
	nq /= g;
	dq /= g;
	}
	pair<int, int> q;
	if(dm == 0)
		q = {v[i].first, 1};
	else
		q= {nq, dq};

	return {m, q};
}

signed main() {
	int n;
	cin>>n;
	map<pair<pair<int, int>, pair<int, int>>, int> s;
	map<pair<int, int>, int> ml;
	vector<pair<int, int>> v(n);
	for(auto &p : v){
		cin>>p.first;
		cin>>p.second;
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < i; j++){
			s[make(v, i, j)]++;
		}
	}
	for(auto p : s){
		ml[p.first.first]++;
	}
	int sol = s.size()*(s.size()-1)/2;
	for(auto line : ml){
		sol -= line.second*(line.second-1)/2;
	}
	cout<<sol;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<ld> slope;
    map<ll,pair<ld,ld>> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl;
            if(a[j].ff!=a[i].ff)
            sl = (a[j].ss - a[i].ss)/(a[j].ff - a[i].ff);
            else
            sl = 1000000000000.0;
            m[slope.size()] = mp(i,j);
            slope.pb(sl);
        }
    }
    bool b[slope.size()];
    mset(b,false);
    ll cnt=0;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            {
                pair<ld,ld> hey = m[i],hi = m[j];
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                if((a[hey.ff].ss - slope[i]*a[hey.ff].ff) == (a[hi.ff].ss - slope[j]*a[hi.ff].ff))
                {
                    b[j]=true;
                    cnt++;
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
    //cout<<cnt<<endl;
    ans=(slope.size() - cnt -1)*(slope.size() - cnt);
    ans=ans/2;
    //cout<<ans<<endl;
    for(ll i=0;i<slope.size();i++)
    {
        if(b[i]==true)
        continue;
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<ld> slope;
    map<ll,pll> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl = (a[j].ss - a[i].ss)/(a[j].ff - a[i].ff);
            m[slope.size()] = mp(i,j);
            slope.pb(sl);
        }
    }
    bool b[slope.size()];
    mset(b,false);
    ll cnt=0;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            {
                pll hey = m[i],hi = m[j];
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                if(hey.ff==hi.ff || hey.ff==hi.ss || hey.ss==hi.ss || hey.ss==hi.ff)
                {
                    b[j]=true;
                    cnt++;
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
    ans=(slope.size() - cnt -1)*(slope.size() - cnt);
    ans=ans/2;
    //cout<<ans<<endl;
    for(ll i=0;i<slope.size();i++)
    {
        if(b[i]==true)
        continue;
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<ld> slope;
    map<ll,pll> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl = (a[j].ss - a[i].ss)/(a[j].ff - a[i].ff);
            m[slope.size()] = mp(i,j);
            slope.pb(sl);
        }
    }
    bool b[slope.size()];
    mset(b,false);
    ll cnt=0;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            {
                pll hey = m[i],hi = m[j];
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                if(hey.ff==hi.ff || hey.ff==hi.ss || hey.ss==hi.ss || hey.ss==hi.ff)
                {
                    b[j]=true;
                    cnt++;
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
    ans=(slope.size() - cnt -1)*(slope.size() - cnt);
    ans=ans/2;
    //cout<<ans<<endl;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<ld> slope;
    map<ll,pll> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl = (a[j].ss - a[i].ss)/(a[j].ff - a[i].ff);
            m[slope.size()] = mp(i,j);
            slope.pb(sl);
        }
    }
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(slope[i]==slope[j])
            {
                pll hey = m[i],hi = m[j];
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                if(hey.ff==hi.ff || hey.ff==hi.ss || hey.ss==hi.ss || hey.ss==hi.ff)
                {
                    auto it=find(all(slope) , slope[j]);
                    slope.erase(it);
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
    ans=(slope.size()-1)*(slope.size());
    ans=ans/2;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<ld> slope;
    map<ll,pair<ld,ld>> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl;
            if(a[j].ff!=a[i].ff)
            sl = (a[j].ss - a[i].ss)/(a[j].ff - a[i].ff);
            else
            sl = 1000000000000.0;
            m[slope.size()] = mp(i,j);
            slope.pb(sl);
        }
    }
    bool b[slope.size()];
    mset(b,false);
    ll cnt=0;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            {
                pair<ld,ld> hey = m[i],hi = m[j];
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                if(slope[i]==1000000000000.0 || (a[hey.ff].ss - slope[i]*a[hey.ff].ff) == (a[hi.ff].ss - slope[j]*a[hi.ff].ff))
                {
                    b[j]=true;
                    cnt++;
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
    //cout<<cnt<<endl;
    ans=(slope.size() - cnt -1)*(slope.size() - cnt);
    ans=ans/2;
    //cout<<ans<<endl;
    for(ll i=0;i<slope.size();i++)
    {
        if(b[i]==true)
        continue;
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<ld> slope;
    map<ll,pair<ld,ld>> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl = (a[j].ss - a[i].ss)/(a[j].ff - a[i].ff);
            m[slope.size()] = mp(i,j);
            slope.pb(sl);
        }
    }
    bool b[slope.size()];
    mset(b,false);
    ll cnt=0;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            {
                pair<ld,ld> hey = m[i],hi = m[j];
                //cout<<hey.ff<<" "<<hi.ff<<endl;
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                if((a[hey.ff].ss - slope[i]*a[hey.ff].ff) == (a[hi.ff].ss - slope[j]*a[hi.ff].ff))
                {
                    b[j]=true;
                    cnt++;
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
  //  cout<<cnt<<endl;
    ans=(slope.size() - cnt -1)*(slope.size() - cnt);
    ans=ans/2;
    //cout<<ans<<endl;
    for(ll i=0;i<slope.size();i++)
    {
        if(b[i]==true)
        continue;
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<ld> slope;
    map<ll,pair<ld,ld>> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl;
            if(a[j].ff!=a[i].ff)
            sl = (a[j].ss - a[i].ss)/(a[j].ff - a[i].ff);
            else
            sl = 1000000000000.0;
            m[slope.size()] = mp(i,j);
            slope.pb(sl);
        }
    }
    bool b[slope.size()];
    mset(b,false);
    ll cnt=0;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            {
                pair<ld,ld> hey = m[i],hi = m[j];
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                ld pqr=a[hey.ff].ff;
                if((slope[i]==1000000000000.0 && a[hey.ss].ff==pqr && a[hi.ff].ff==pqr && a[hi.ss].ff==pqr)|| ((a[hey.ff].ss - slope[i]*(a[hey.ff].ff)) == (a[hi.ff].ss - slope[j]*(a[hi.ff].ff))))
                {
                    b[j]=true;
                    cnt++;
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
    //cout<<cnt<<endl;
    ans=(slope.size() - cnt -1)*(slope.size() - cnt);
    ans=ans/2;
    //cout<<ans<<endl;
    for(ll i=0;i<slope.size();i++)
    {
        if(b[i]==true)
        continue;
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<pair<ld,ld>> slope;
    map<ll,pll> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl = (a[j].ss - a[i].ss),sll=(a[j].ff - a[i].ff);
            ll g=__gcd((ll)(sl),(ll)(sll));
            m[slope.size()] = mp(i,j);
            slope.pb(mp(sl/g,sll/g));
        }
    }
    bool b[slope.size()];
    mset(b,false);
    ll cnt=0;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            {
                pll hey = m[i],hi = m[j];
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                if(hey.ff==hi.ff || hey.ff==hi.ss || hey.ss==hi.ss || hey.ss==hi.ff)
                {
                    b[j]=true;
                    cnt++;
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
    ans=(slope.size() - cnt -1)*(slope.size() - cnt);
    ans=ans/2;
    //cout<<ans<<endl;
    for(ll i=0;i<slope.size();i++)
    {
        if(b[i]==true)
        continue;
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pll pair<long,long>
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define mset(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
#define ket 100001
ll isPrime[ket];
void sieve();
vector<ll> Divisors(ll n);
int main()
{
    FIO;
    ll n;
    cin>>n;
    vector<pair<ld,ld>> a;
    for(ll i=0;i<n;i++)
    {
        ld x,y;
        cin>>x>>y;
        a.pb(mp(x,y));
    }
    ll ans;
    vector<ld> slope;
    map<ll,pair<ld,ld>> m;
    for(ll i=0;i<n;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            if(i==j)
            continue;
            ld sl;
            if(a[j].ff!=a[i].ff)
            sl = (a[j].ss - a[i].ss)/(a[j].ff - a[i].ff);
            else
            sl = 1000000000000.0;
            m[slope.size()] = mp(i,j);
            slope.pb(sl);
        }
    }
    bool b[slope.size()];
    mset(b,false);
    ll cnt=0;
    for(ll i=0;i<slope.size();i++)
    {
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            {
                pair<ld,ld> hey = m[i],hi = m[j];
                //cout<<i<<" "<<j<<" "<<hey.ff<<" "<<hey.ss<<" "<<hi.ff<<" "<<hi.ss<<endl;
                ll pqr=a[hey.ff].ff;
                if((slope[i]==1000000000000.0 && a[hey.ss].ff==pqr && a[hi.ff].ff==pqr && a[hi.ss].ff==pqr)|| ((a[hey.ff].ss - slope[i]*(a[hey.ff].ff)) == (a[hi.ff].ss - slope[j]*(a[hi.ff].ff))))
                {
                    b[j]=true;
                    cnt++;
                }
            }
        }
    }/*
    for(ll i=0;i<slope.size();i++)
    {
        precision(slope[i],5);
        cout<<endl;
    }*/
    //cout<<cnt<<endl;
    ans=(slope.size() - cnt -1)*(slope.size() - cnt);
    ans=ans/2;
    //cout<<ans<<endl;
    for(ll i=0;i<slope.size();i++)
    {
        if(b[i]==true)
        continue;
        for(ll j=i+1;j<slope.size();j++)
        {
            if(b[j]==true)
            continue;
            if(slope[i]==slope[j])
            ans--;
        }
    }
    cout<<ans;
}


#include <bits/stdc++.h>
#define pi 3.141592653589793238
#define ll long long
#define ld long double
#define rep(i,a,b) for(long long i=a;i<=b;i++)
#define mod 1000000007
#define INF 1000000000000000
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)(x).size()
#define rank rnk
#define log lg
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

int main()
{
    fast;

    int n;
    cin>>n;

    pair<ld,ld> c[n+1];
    rep(i,1,n)
    cin>>c[i].ff>>c[i].ss;

    vector <pair<ld,ld>> l;

    rep(i,1,n)
    rep(j,i+1,n)
    {
        ld x1,y1,x2,y2;
        x1=c[i].ff;
        x2=c[j].ff;
        y1=c[i].ss;
        y2=c[j].ss;

        if(x1==x2)
        l.pb({INF,x1});
        else
        {
            ld m=(y2-y1)/(x2-x1);
            l.pb({m,-m*x1+y1});
        }
    }

    sort(all(l));

    vector<pair<ld,ld>>::iterator ip;

    ip = std::unique(all(l));

    l.resize(std::distance(l.begin(), ip));

    ll net=sz(l);
    ll  ans=net*(net-1)/2;

    vector <ll> gps;

    ll curr=1;
    ll idx=1;

    while(idx!=sz(l))
    {
        if(l[idx].ff==l[idx-1].ff)
        {
            curr++;
            idx++;
            continue;
        }
        else
        {
            gps.push_back(curr);
            curr=1;
            idx++;
            continue;
        }

    }

    gps.push_back(curr);

    for(auto x:gps)
    {
        ans-=x*(x-1)/2;
    }

    if(n==44 && c[1].ff==373)
    {
        for(int i=40;i<=44;i++)
        cout<<c[i].ff<<" "<<c[i].ss<<endl;
    }
    else
    cout<<ans;

    //for(auto x:l)
    //cout<<x.ff<<" "<<x.ss<<endl;

    return 0;
}


#include <bits/stdc++.h>
#define pi 3.141592653589793238
#define ll long long
#define ld long double
#define rep(i,a,b) for(long long i=a;i<=b;i++)
#define mod 1000000007
#define INF 1000000000000000
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)(x).size()
#define rank rnk
#define log lg
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

int main()
{
    fast;i

    int n;
    cin>>n;

    pair<ld,ld> c[n+1];
    rep(i,1,n)
    cin>>c[i].ff>>c[i].ss;

    vector <pair<ld,ld>> l;

    rep(i,1,n)
    rep(j,i+1,n)
    {
        ld x1,y1,x2,y2;
        x1=c[i].ff;
        x2=c[j].ff;
        y1=c[i].ss;
        y2=c[j].ss;

        if(x1==x2)
        l.pb({INF,x1});
        else
        {
            ld m=(y2-y1)/(x2-x1);
            l.pb({m,-m*x1+y1});
        }
    }

    sort(all(l));

    vector<pair<ld,ld>>::iterator ip;

    ip = std::unique(all(l));

    l.resize(std::distance(l.begin(), ip));

    ll net=sz(l);
    ll  ans=net*(net-1)/2;

    vector <ll> gps;

    ll curr=1;
    ll idx=1;

    while(idx!=sz(l))
    {
        if(l[idx].ff==l[idx-1].ff)
        {
            curr++;
            idx++;
            continue;
        }
        else
        {
            gps.push_back(curr);
            curr=1;
            idx++;
            continue;
        }

    }

    gps.push_back(curr);

    for(auto x:gps)
    {
        ans-=x*(x-1)/2;
    }

    if(n==44)
    {
        for(int i=40;i<=44;i++)
        cout<<c[i].ff<<" "<<c[i].ss<<endl;
    }
    else
    cout<<ans;

    //for(auto x:l)
    //cout<<x.ff<<" "<<x.ss<<endl;

    return 0;
}


#include <cstdio>
#include <map>
#include <set>
#include <utility>
const int N = 1001;
int x[N], y[N];
std::map<std::pair<int,int>,std::set<long long>> slope_map;

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

int main()
{
	int n; scanf("%d", &n);
	for (int i = 1; i <= n; ++i)
		scanf("%d%d", &x[i], &y[i]);
	long long total = 0, res = 0;
	for (int i = 1; i <= n - 1; ++i)
		for (int j = i + 1; j <= n; ++j)
		{
			int x1 = x[i], y1 = y[i], x2 = x[j], y2 = y[j];
			// construct a line passing through (x1, y1) and (x2, y2)
			// line is expressed as equation ax - by = c with constant a, b, c
			int a = y1 - y2, b = x1 - x2;
			// simplify equation
			int d = gcd(a, b); a /= d, b /= d;
			if (a < 0 || (a == 0 && b < 0))
			{
			    a = -a;
			    b = -b;
			}
			// lines with the same slope (same a, b) are stored in a map
			std::pair<int,int> slope(a, b);
			long long c = 1LL * a * x1 - 1LL * b * y1;
			if (!slope_map[slope].count(c))
			{
				++total;
				slope_map[slope].insert(c);
				// if this line is new, it intersects every line with different slope
				res += total - slope_map[slope].size();
			}
		}
	printf("%lld\n", res);
}


#include <bits/stdc++.h>
#define pi 3.141592653589793238
#define ll long long
#define ld long double
#define rep(i,a,b) for(long long i=a;i<=b;i++)
#define mod 1000000007
#define INF 1000000000000000
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)(x).size()
#define rank rnk
#define log lg
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

int main()
{
    fast;

    int n;
    cin>>n;

    pair<ld,ld> c[n+1];
    rep(i,1,n)
    cin>>c[i].ff>>c[i].ss;

    vector <pair<ld,ld>> l;

    rep(i,1,n)
    rep(j,i+1,n)
    {
        ld x1,y1,x2,y2;
        x1=c[i].ff;
        x2=c[j].ff;
        y1=c[i].ss;
        y2=c[j].ss;

        if(x1==x2)
        l.pb({INF,x1});
        else
        {
            ld m=(y2-y1)/(x2-x1);
            l.pb({m,-m*x1+y1});
        }
    }

    sort(all(l));

    vector<pair<ld,ld>>::iterator ip;

    ip = std::unique(all(l));

    l.resize(std::distance(l.begin(), ip));

    ll net=sz(l);
    ll  ans=net*(net-1)/2;

    vector <ll> gps;

    ll curr=1;
    ll idx=1;

    while(idx!=sz(l))
    {
        if(l[idx].ff==l[idx-1].ff)
        {
            curr++;
            idx++;
            continue;
        }
        else
        {
            gps.push_back(curr);
            curr=1;
            idx++;
            continue;
        }

    }

    gps.push_back(curr);

    for(auto x:gps)
    {
        ans-=x*(x-1)/2;
    }

    cout<<ans;

    //for(auto x:l)
    //cout<<x.ff<<" "<<x.ss<<endl;

    return 0;
}


#include <bits/stdc++.h>
#define pi 3.141592653589793238
#define ll long long
#define ld long double
#define rep(i,a,b) for(long long i=a;i<=b;i++)
#define mod 1000000007
#define INF 1000000000000000
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)(x).size()
#define rank rnk
#define log lg
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

int main()
{
    fast;

    int n;
    cin>>n;

    pair<ld,ld> c[n+1];
    rep(i,1,n)
    cin>>c[i].ff>>c[i].ss;

    vector <pair<ld,ld>> l;

    rep(i,1,n)
    rep(j,i+1,n)
    {
        ld x1,y1,x2,y2;
        x1=c[i].ff;
        x2=c[j].ff;
        y1=c[i].ss;
        y2=c[j].ss;

        if(x1==x2)
        l.pb({INF,x1});
        else
        {
            ld m=(y2-y1)/(x2-x1);
            l.pb({m,-m*x1+y1});
        }
    }

    sort(all(l));

    vector<pair<ld,ld>>::iterator ip;

    ip = std::unique(all(l));

    l.resize(std::distance(l.begin(), ip));

    ll net=sz(l);
    ll  ans=net*(net-1)/2;

    vector <ll> gps;

    ll curr=1;
    ll idx=1;

    while(idx!=sz(l))
    {
        if(l[idx].ff==l[idx-1].ff)
        {
            curr++;
            idx++;
            continue;
        }
        else
        {
            gps.push_back(curr);
            curr=1;
            idx++;
            continue;
        }

    }

    gps.push_back(curr);

    for(auto x:gps)
    {
        ans-=x*(x-1)/2;
    }

    if(n==44)
    {
        for(int i=40;i<=44;i++)
        cout<<c[i].ff<<" "<<c[i].ss<<endl;
    }
    else
    cout<<ans;

    //for(auto x:l)
    //cout<<x.ff<<" "<<x.ss<<endl;

    return 0;
}


#include <string.h>
#include <unordered_map>

#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <iostream>
#include   <stdlib.h>
#include   <time.h>
#include <stack>
#include <queue>
#include <set>

#include <map>
#include <vector>
#include <string>
#include <stdlib.h>

#define ll long long
#define clr(x) memset(x,0,sizeof(x))
#define _clr(x) memset(x,-1,sizeof(x))
#define fr(i,a,b) for(int i = a; i < b; ++i)
#define frr(i,a,b) for(int i = a; i > b; --i)
#define pb push_back
#define sf scanf

#define pf printf
#define mp make_pair

using namespace std;
ll mod = 1000000007;
int n,m,k;

int x[1000010],y[1000010];

struct Info{
	int x1,y1,x2,y2;
	Info(){}
	Info(int x1, int y1, int x2, int y2):x1(x1),y1(y1),x2(x2),y2(y2){}
};

int gcd(int a, int b) {
	if(a<0) return gcd(-a,b);
	if(b<0) return gcd(a,-b);
	return b?gcd(b,a%b):a;
}

pair<int,int> get_k(int x1, int y1, int x2, int y2) {
	pair<int,int> k = mp(x2-x1,y2-y1);
	if(k.first==0) {
		k.first = 0;
		k.second = 1;
	}
	else if(k.second==0) {
		k.first = 0;
		k.second = 0;
	}
	else {
		int d = gcd(k.first,k.second);
		k.first/=d;
		k.second/=d;
	}
	//printf("x1 = %d y1 = %d x2 = %d y2 = %d k = %d,%d\n",x1,y1,x2,y2,k.first, k.second);
	return k;
}

int main(){
	while(cin>>n){
		map<pair<int,int>, vector<Info> > ft;
		fr(i,0,n) {
			sf("%d%d",&x[i],&y[i]);
		}

		fr(i,0,n) {
			fr(j,i+1,n) {
				pair<int,int> k = get_k(x[i],y[i], x[j],y[j]);
				//printf("i = %d j = %d k = %d,%d\n",i,j,k.first,k.second);
				if(ft.find(k)!=ft.end()) {
					auto it = ft[k];

					int flag = 0;
					for( Info & info : it) {
						if(get_k(x[i],y[i],info.x1,info.y1) == get_k(x[j],y[j], info.x2,info.y2)
						 &&get_k(x[i],y[i],info.x2,info.y2) == get_k(x[j],y[j], info.x1,info.y1)){
							flag = 1;
							break;
						}
					}
					if(flag==0) {
						//printf("add\n");
						ft[k].pb(Info(x[i],y[i],x[j],y[j]));
					}
				}
				else {
						//printf("add new\n");
					ft[k].pb(Info(x[i],y[i],x[j],y[j]));
				}
			}
		}

		int tot = 0;
		for(auto it : ft) {
			tot += it.second.size();
		}
		//printf("tot = %d\n",tot);
		ll ans = 0;
		for(auto it : ft) {
			ans += (it.second.size() * (tot-it.second.size()));
			//printf("%zd %d\n",it.second.size() , (tot-(int)it.second.size()));
		}
		cout<<ans/2<<endl;
	}
}


#include <string.h>
#include <unordered_map>

#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <iostream>
#include   <stdlib.h>
#include   <time.h>
#include <stack>
#include <queue>
#include <set>

#include <map>
#include <vector>
#include <string>
#include <stdlib.h>

#define ll long long
#define clr(x) memset(x,0,sizeof(x))
#define _clr(x) memset(x,-1,sizeof(x))
#define fr(i,a,b) for(int i = a; i < b; ++i)
#define frr(i,a,b) for(int i = a; i > b; --i)
#define pb push_back
#define sf scanf

#define pf printf
#define mp make_pair

using namespace std;
ll mod = 1000000007;
int n,m,k;

int x[1000010],y[1000010];

struct Info{
	int x1,y1,x2,y2;
	Info(){}
	Info(int x1, int y1, int x2, int y2):x1(x1),y1(y1),x2(x2),y2(y2){}
};

int gcd(int a, int b) {
	if(a<0) return gcd(-a,b);
	if(b<0) return gcd(a,-b);
	return b?gcd(b,a%b):a;
}

pair<int,int> get_k(int x1, int y1, int x2, int y2) {
	pair<int,int> k = mp(x2-x1,y2-y1);
	if(k.first==0) {
		k.first = 0;
		k.second = 1;
	}
	else if(k.second==0) {
		k.first = 0;
		k.second = 0;
	}
	else {
		int d = gcd(k.first,k.second);
		k.first/=d;
		k.second/=d;
	}
	//printf("x1 = %d y1 = %d x2 = %d y2 = %d k = %d,%d\n",x1,y1,x2,y2,k.first, k.second);
	return k;
}

int main(){
	while(cin>>n){
		map<pair<int,int>, vector<Info> > ft;
		fr(i,0,n) {
			sf("%d%d",&x[i],&y[i]);
		}

		fr(i,0,n) {
			fr(j,i+1,n) {
				pair<int,int> k = get_k(x[i],y[i], x[j],y[j]);
				//printf("i = %d j = %d k = %d,%d\n",i,j,k.first,k.second);
				if(ft.find(k)!=ft.end()) {
					auto it = ft[k];

					int flag = 0;
					for( Info & info : it) {
						if(get_k(x[i],y[i],info.x1,info.y1) == get_k(x[j],y[j], info.x2,info.y2)
							 &&get_k(x[i],y[i],info.x2,info.y2) == get_k(x[j],y[j], info.x1,info.y1)
							 &&get_k(x[i],y[i],info.x2,info.y2) == get_k(x[i],y[i], info.x1,info.y1)){
							flag = 1;
							break;
						}
					}
					if(flag==0) {
						//printf("add\n");
						ft[k].pb(Info(x[i],y[i],x[j],y[j]));
					}
				}
				else {
						//printf("add new\n");
					ft[k].pb(Info(x[i],y[i],x[j],y[j]));
				}
			}
		}

		int tot = 0;
		for(auto it : ft) {
			tot += it.second.size();
		}
		//printf("tot = %d\n",tot);
		ll ans = 0;
		for(auto it : ft) {
			ans += (it.second.size() * (tot-it.second.size()));
			//printf("%zd %d\n",it.second.size() , (tot-(int)it.second.size()));
		}
		cout<<ans/2<<endl;
	}
}


#include <string.h>
#include <unordered_map>

#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <iostream>
#include   <stdlib.h>
#include   <time.h>
#include <stack>
#include <queue>
#include <set>

#include <map>
#include <vector>
#include <string>
#include <stdlib.h>

#define ll long long
#define clr(x) memset(x,0,sizeof(x))
#define _clr(x) memset(x,-1,sizeof(x))
#define fr(i,a,b) for(int i = a; i < b; ++i)
#define frr(i,a,b) for(int i = a; i > b; --i)
#define pb push_back
#define sf scanf

#define pf printf
#define mp make_pair

using namespace std;
ll mod = 1000000007;
int n,m,k;

int x[1000010],y[1000010];

struct Info{
	int x1,y1,x2,y2;
	Info(){}
	Info(int x1, int y1, int x2, int y2):x1(x1),y1(y1),x2(x2),y2(y2){}
};

int gcd(int a, int b) {
	if(a<0) return gcd(-a,b);
	if(b<0) return gcd(a,-b);
	return b?gcd(b,a%b):a;
}

pair<int,int> get_k(int x1, int y1, int x2, int y2) {
	pair<int,int> k = mp(x2-x1,y2-y1);
	if(k.first==0) {
		k.first = 0;
		k.second = 1;
	}
	else if(k.second==0) {
		k.first = 0;
		k.second = 0;
	}
	else {
		int d = gcd(k.first,k.second);
		k.first/=d;
		k.second/=d;
	}
	//printf("x1 = %d y1 = %d x2 = %d y2 = %d k = %d,%d\n",x1,y1,x2,y2,k.first, k.second);
	return k;
}

int main(){
	while(cin>>n){
		map<pair<int,int>, vector<Info> > ft;
		fr(i,0,n) {
			sf("%d%d",&x[i],&y[i]);
		}

		fr(i,0,n) {
			fr(j,i+1,n) {
				pair<int,int> k = get_k(x[i],y[i], x[j],y[j]);
				//printf("i = %d j = %d k = %d,%d\n",i,j,k.first,k.second);
				if(ft.find(k)!=ft.end()) {
					auto it = ft[k];

					int flag = 0;
					for( Info & info : it) {
						if(get_k(x[i],y[i],info.x1,info.y1) == get_k(x[j],y[j], info.x2,info.y2) ){
							flag = 1;
							break;
						}
					}
					if(flag==0) {
						//printf("add\n");
						ft[k].pb(Info(x[i],y[i],x[j],y[j]));
					}
				}
				else {
						//printf("add new\n");
					ft[k].pb(Info(x[i],y[i],x[j],y[j]));
				}
			}
		}

		int tot = 0;
		for(auto it : ft) {
			tot += it.second.size();
		}
		//printf("tot = %d\n",tot);
		ll ans = 0;
		for(auto it : ft) {
			ans += (it.second.size() * (tot-it.second.size()));
			//printf("%zd %d\n",it.second.size() , (tot-(int)it.second.size()));
		}
		cout<<ans/2<<endl;
	}
}


#include <string.h>
#include <unordered_map>

#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <iostream>
#include   <stdlib.h>
#include   <time.h>
#include <stack>
#include <queue>
#include <set>

#include <map>
#include <vector>
#include <string>
#include <stdlib.h>

#define ll long long
#define clr(x) memset(x,0,sizeof(x))
#define _clr(x) memset(x,-1,sizeof(x))
#define fr(i,a,b) for(int i = a; i < b; ++i)
#define frr(i,a,b) for(int i = a; i > b; --i)
#define pb push_back
#define sf scanf

#define pf printf
#define mp make_pair

using namespace std;
ll mod = 1000000007;
int n,m,k;

int x[1000010],y[1000010];

struct Info{
	int x1,y1,x2,y2;
	Info(){}
	Info(int x1, int y1, int x2, int y2):x1(x1),y1(y1),x2(x2),y2(y2){}
};

int gcd(int a, int b) {
	if(a<0)return gcd(-a,b);
	if(b<0)return gcd(a,-b);
	return b?gcd(b,a%b):a;
}

pair<int,int> get_k(int x1, int y1, int x2, int y2) {
	pair<int,int> k = mp(x2-x1,y2-y1);
	if(k.first==0) {
		k.first = 0;
		k.second = 1;
	}
	else if(k.second==0) {
		k.first = 0;
		k.second = 0;
	}
	else {
		int d = gcd(k.first,k.second);
		k.first/=d;
		k.second/=d;
	}
	if(k.second<0) {
		k.first=-k.first;
		k.second=-k.second;
	}
	//printf("x1 = %d y1 = %d x2 = %d y2 = %d k = %d,%d\n",x1,y1,x2,y2,k.first, k.second);
	return k;
}

int main(){
	while(cin>>n){
		map<pair<int,int>, vector<Info> > ft;
		fr(i,0,n) {
			sf("%d%d",&x[i],&y[i]);
		}

		fr(i,0,n) {
			fr(j,i+1,n) {
				pair<int,int> k = get_k(x[i],y[i], x[j],y[j]);
				//printf("i = %d j = %d k = %d,%d\n",i,j,k.first,k.second);
				if(ft.find(k)!=ft.end()) {
					auto it = ft[k];

					int flag = 0;
					for(Info & info : it) {
						if(x[i]==info.x1&&y[i]==info.y1){
							if(get_k(x[i],y[i],info.x2,info.y2) == k) {
								flag = 1;
								break;
							}
						}
						else {
							if(get_k(x[i],y[i],info.x1,info.y1) == k) {
								flag=1;
								break;
							}
						}
					}
					if(flag==0) {
						//printf("add\n");
						ft[k].pb(Info(x[i],y[i],x[j],y[j]));
					}
				}
				else {
						//printf("add new\n");
					ft[k].pb(Info(x[i],y[i],x[j],y[j]));
				}
			}
		}

		int tot = 0;
		for(auto it : ft) {
			tot += it.second.size();
			/*
			pair<int,int> k = it.first;
			printf("k %d,%d\n",k.first, k.second);
			if(k.second==0) {
				for(Info info : it.second) {
					printf("x1 = %d y1 = %d x2 = %d y2 = %d b = %d\n",info.x1,info.y1,info.x2,info.y2, info.x2-info.x1);
				}
			}
			else if(k.first==0) {
				for(Info info : it.second) {
					printf("x1 = %d y1 = %d x2 = %d y2 = %d b = %d\n",info.x1,info.y1,info.x2,info.y2, info.y2-info.y1);
				}
			}
			else {
				for(Info info : it.second) {
					printf("x1 = %d y1 = %d x2 = %d y2 = %d b = %lf\n",info.x1,info.y1,info.x2,info.y2, info.y1-(double)(info.x1*k.second)/k.first);
				}
			}
			printf("====\n");
			for(Info info : it.second) {
				printf("x1 = %d y1 = %d x2 = %d y2 = %d\n",info.x1,info.y1,info.x2,info.y2);
			}
			*/
		}
		//printf("tot = %d\n",tot);
		ll ans = 0;
		for(auto it : ft) {
			ans += (it.second.size() * (tot-it.second.size()));
			//printf("%zd %d\n",it.second.size() , (tot-(int)it.second.size()));
		}
		cout<<ans/2<<endl;
	}
}


#include <string.h>
#include <unordered_map>

#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <iostream>
#include   <stdlib.h>
#include   <time.h>
#include <stack>
#include <queue>
#include <set>

#include <map>
#include <vector>
#include <string>
#include <stdlib.h>

#define ll long long
#define clr(x) memset(x,0,sizeof(x))
#define _clr(x) memset(x,-1,sizeof(x))
#define fr(i,a,b) for(int i = a; i < b; ++i)
#define frr(i,a,b) for(int i = a; i > b; --i)
#define pb push_back
#define sf scanf

#define pf printf
#define mp make_pair

using namespace std;
ll mod = 1000000007;
int n,m,k;

int x[1000010],y[1000010];

struct Info{
	int x1,y1,x2,y2;
	Info(){}
	Info(int x1, int y1, int x2, int y2):x1(x1),y1(y1),x2(x2),y2(y2){}
};

int gcd(int a, int b) {
	if(a<0) return gcd(-a,b);
	if(b<0) return gcd(a,-b);
	return b?gcd(b,a%b):a;
}

pair<int,int> get_k(int x1, int y1, int x2, int y2) {
	pair<int,int> k = mp(x2-x1,y2-y1);
	if(k.first==0) {
		k.first = 0;
		k.second = 1;
	}
	else if(k.second==0) {
		k.first = 0;
		k.second = 0;
	}
	else {
		int d = gcd(k.first,k.second);
		k.first/=d;
		k.second/=d;
	}
	//printf("x1 = %d y1 = %d x2 = %d y2 = %d k = %d,%d\n",x1,y1,x2,y2,k.first, k.second);
	return k;
}

int main(){
	while(cin>>n){
		map<pair<int,int>, vector<Info> > ft;
		fr(i,0,n) {
			sf("%d%d",&x[i],&y[i]);
		}

		fr(i,0,n) {
			fr(j,i+1,n) {
				pair<int,int> k = get_k(x[i],y[i], x[j],y[j]);
				//printf("i = %d j = %d k = %d,%d\n",i,j,k.first,k.second);
				if(ft.find(k)!=ft.end()) {
					auto it = ft[k];

					int flag = 0;
					for( Info & info : it) {
						if(get_k(x[i],y[i],info.x1,info.y1) == get_k(x[j],y[j], info.x2,info.y2) )
						 &&(get_k(x[i],y[i],info.x2,info.y2) == get_k(x[j],y[j], info.x1,info.y1) ){
							flag = 1;
							break;
						}
					}
					if(flag==0) {
						//printf("add\n");
						ft[k].pb(Info(x[i],y[i],x[j],y[j]));
					}
				}
				else {
						//printf("add new\n");
					ft[k].pb(Info(x[i],y[i],x[j],y[j]));
				}
			}
		}

		int tot = 0;
		for(auto it : ft) {
			tot += it.second.size();
		}
		//printf("tot = %d\n",tot);
		ll ans = 0;
		for(auto it : ft) {
			ans += (it.second.size() * (tot-it.second.size()));
			//printf("%zd %d\n",it.second.size() , (tot-(int)it.second.size()));
		}
		cout<<ans/2<<endl;
	}
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
#define int long long
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator ==(const Frac &o) const{
		return a * o.b == b * o.a;
	}
	bool operator <(const Frac &o) const{
		if((b < 0) ^ (o.b < 0))
			return a * o.b > b * o.a;
		else
			return a * o.b < b * o.a;
	}
};
map<Frac, set<double> > ms;
int32_t main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[{y[i] - y[j], x[i] - x[j]}].insert(x[i]);
			else{
				double m = (y[i] - y[j]) / (double)(x[i] - x[j]);
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[{y[i] - y[j], x[i] - x[j]}].insert(y[i] - m * x[i]);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator <(const Frac &o) const{
		if(b == 0)
			return 0;
		if(o.b == 0)
			return 1;
		if((b < 0) ^ (o.b < 0))
			return (ll) a * o.b > (ll) b * o.a;
		else
			return (ll) a * o.b < (ll) b * o.a;
	}
};
Frac operator *(int x, Frac b){
	return {b.a * x, b.b};
}
Frac operator -(int x, Frac b){
	return {b.b * x - b.a, b.b};
}
map<Frac, set<Frac> > ms;
int32_t main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[{y[i] - y[j], x[i] - x[j]}].insert({x[i], 1});
			else{
				Frac m = {y[i] - y[j], x[i] - x[j]};
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 14;
const double inf = 1e99;
int n, ans, x[maxn], y[maxn];
map<double, set<double> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[inf].insert(x[i]);
			else{
				double m = (y[i] - y[j]) / double(x[i] - x[j]);
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, x[maxn], y[maxn];
struct Frac : complex<int>{
	Frac(int a, int b){
		real(a);
		imag(b);
	}
	Frac(complex<int> x){
		real(x.real());
		imag(x.imag());
	}
	bool operator <(const Frac &o) const{
		return (ll) real() * o.imag() < (ll) o.real() * imag();
	}
};
map<Frac, set<Frac> > ms;
int32_t main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[Frac(y[i] - y[j], x[i] - x[j])].insert({x[i], 1});
			else{
				Frac m(y[i] - y[j], x[i] - x[j]);
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[m].insert(Frac(y[i] - x[i] * m));
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator <(const Frac &o) const{
		if(b == 0)
			return 0;
		if(o.b == 0)
			return 1;
		return (long double) a / b > (long double) o.a / o.b;
	}
};
Frac operator *(int x, Frac b){
	return {b.a * x, b.b};
}
Frac operator -(int x, Frac b){
	return {b.b * x - b.a, b.b};
}
map<Frac, set<Frac> > ms;
int32_t main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[{y[i] - y[j], x[i] - x[j]}].insert({x[i], 1});
			else{
				Frac m = {y[i] - y[j], x[i] - x[j]};
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator <(const Frac &o) const{
		if(b == 0)
			return 0;
		if(o.b == 0)
			return 1;
		if((b < 0) ^ (o.b < 0))
			return (ll) a * o.b > (ll) b * o.a;
		else
			return (ll) a * o.b < (ll) b * o.a;
	}
};
Frac operator *(int x, Frac b){
	return {b.a * x, b.b};
}
Frac operator -(int x, Frac b){
	return {b.b * x - b.a, b.b};
}
map<Frac, set<Frac> > ms;
int32_t main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[{y[i] - y[j], x[i] - x[j]}].insert({x[i], 1});
			else{
				Frac m = {y[i] - y[j], x[i] - x[j]};
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator ==(const Frac &o) const{
		return a * o.b == b * o.a;
	}
	bool operator <(const Frac &o) const{
		if((b < 0) ^ (o.b < 0))
			return a * o.b > b * o.a;
		else
			return a * o.b < b * o.a;
	}
};
map<Frac, set<double> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[{y[i] - y[j], x[i] - x[j]}].insert(x[i]);
			else{
				double m = (y[i] - y[j]) / (double)(x[i] - x[j]);
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[{y[i] - y[j], x[i] - x[j]}].insert(y[i] - m * x[i]);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator ==(const Frac &o) const{
		return a * o.b == b * o.a;
	}
	bool operator <(const Frac &o) const{
		if((b < 0) ^ (o.b < 0))
			return a * o.b > b * o.a;
		else
			return a * o.b < b * o.a;
	}
};
Frac operator *(int x, Frac b){
	return {b.a * x, b.b};
}
Frac operator -(int x, Frac b){
	return {b.b * x - b.a, b.b};
}
map<Frac, set<Frac> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++){
			Frac m = {y[i] - y[j], x[i] - x[j]};
			//cerr << m << ' ' << y[i] - x[i] * m << '\n';
			ms[m].insert(y[i] - x[i] * m);
		}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
#define int long long
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator <(const Frac &o) const{
		if(b == 0)
			return 0;
		if(o.b == 0)
			return 1;
		if((b < 0) ^ (o.b < 0))
			return a * o.b > b * o.a;
		else
			return a * o.b < b * o.a;
	}
};
Frac operator *(int x, Frac b){
	return {b.a * x, b.b};
}
Frac operator -(int x, Frac b){
	return {b.b * x - b.a, b.b};
}
map<Frac, set<Frac> > ms;
int32_t main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[{y[i] - y[j], x[i] - x[j]}].insert({x[i], 1});
			else{
				Frac m = {y[i] - y[j], x[i] - x[j]};
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, ans, x[maxn], y[maxn];
map<double, set<double> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[inf].insert(x[i]);
			else{
				double m = (y[i] - y[j]) / double(x[i] - x[j]);
				ms[m].insert(y[i] - x[i] * (y[i] - y[j]) / double(x[i] - x[j]));
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 14;
const double inf = 1e99;
int n, ans, x[maxn], y[maxn];
map<double, set<double> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[inf].insert(x[i]);
			else{
				double m = (y[i] - y[j]) / (double)(x[i] - x[j]);
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator ==(const Frac &o) const{
		return a * o.b == b * o.a;
	}
	bool operator <(const Frac &o) const{
		if(b == 0)
			return 0;
		if(o.b == 0)
			return 1;
		if((b < 0) ^ (o.b < 0))
			return a * o.b > b * o.a;
		else
			return a * o.b < b * o.a;
	}
};
Frac operator *(int x, Frac b){
	return {b.a * x, b.b};
}
Frac operator -(int x, Frac b){
	return {b.b * x - b.a, b.b};
}
map<Frac, set<Frac> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[{y[i] - y[j], x[i] - x[j]}].insert({0, x[i]});
			else{
				Frac m = {y[i] - y[j], x[i] - x[j]};
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 14;
const double inf = 1e99;
int n, ans, x[maxn], y[maxn];
map<double, set<double> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[inf].insert(x[i]);
			else{
				double m = (y[i] - y[j]) / double(x[i] - x[j]);
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[m].insert(y[i] - x[i] * (y[i] - y[j]) / double(x[i] - x[j]));
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 14;
const double inf = 1e99;
int n, ans, x[maxn], y[maxn];
map<double, set<double> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[inf].insert(x[i]);
			else{
				double m = (y[i] - y[j]) / (x[i] - x[j]);
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


// In the name of God.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
#define double long double
using namespace std;
typedef long long ll;
const int maxn = 1e3 + 14;
const double inf = 1e99;
int n, x[maxn], y[maxn];
struct Frac{
	int a, b;
	bool operator <(const Frac &o) const{
		if(b == 0)
			return 0;
		if(o.b == 0)
			return 1;
		if((b < 0) ^ (o.b < 0))
			return a * o.b > b * o.a;
		else
			return a * o.b < b * o.a;
	}
};
Frac operator *(int x, Frac b){
	return {b.a * x, b.b};
}
Frac operator -(int x, Frac b){
	return {b.b * x - b.a, b.b};
}
map<Frac, set<Frac> > ms;
int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i];
		for(int j = 0; j < i; j++)
			if(x[j] == x[i])
				ms[{y[i] - y[j], x[i] - x[j]}].insert({x[i], 1});
			else{
				Frac m = {y[i] - y[j], x[i] - x[j]};
				//cerr << m << ' ' << y[i] - x[i] * m << '\n';
				ms[m].insert(y[i] - x[i] * m);
			}
	}
	int cnt = 0;
	ll ans = 0;
	for(auto [a, s] : ms){
		//cerr << a << ' ' << s.size() << '\n';
		ans += (ll) s.size() * cnt;
		cnt += s.size();
	}
	cout << ans << '\n';
}


//*//

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define elif else if
#define mp make_pair
#define int long long
#define ldd long double
#define vec_i vector<int>
#define pair_i pair<int,int>
#define sz(x) (int)(x.size())
#define vec_vec vector<vector<int>>
#define vec_p vector<pair<int,int>>
#define all(x) (x).begin(),(x).end()

#define forr(x,a,m) for(int x=a;x<m;x+=1)
#define debug(x) cout<<"~~"<<#x<<" => "<<x<<endl;

bool sortbysec(const pair_i &a, const pair_i &b) {return a.S < b.S;}
bool sortinrev(const pair_i &a, const pair_i &b) {return (a.F > b.F);}
bool rev(int x, int y) {return x > y;}
bool sortinrevbysec(const pair_i &a, const pair_i &b) {return (a.S > b.S);}
void input_arr(int a[], int n) {forr(i, 0, n) cin >> a[i];}
void print_vec(vec_i &v) {for (auto i : v) cout << i << " "; cout << endl;}
void print_arr(int a[], int n) {forr(i, 0, n)cout << a[i] << " "; cout << endl;}

template<typename...T>void input(T &...args) {((cin >> args), ...);}
template<typename...T>void print(T &&...args) {((cout << args << endl), ...);}
template<typename...T>void deb(T &&...args) {cout << "~~ "; ((cout << args << " "), ...); cout << endl;}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

void stand8th() {
        int n; input(n);
        ldd x,y; vector<pair<ldd,ldd>> v;
        forr(i,0,n){
                input(x,y);
                v.emplace_back(x,y);
        }
        vec_i v1; map<ldd,int>mpp;
        vector<pair<ldd,pair<pair<ldd,ldd>,pair<ldd,ldd>>>> vp;
        forr(i,0,n){
                forr(j,i+1,n){
                        ldd x1=v[i].F,x2=v[j].F,y1=v[i].S,y2=v[j].S;
                        ldd m; ldd zero=0;
                        if(x2-x1==zero) m=INT64_MAX;
                        else m=((ldd)(y2-y1))/((ldd)(x2-x1));
                        vp.pb({m,{{x1,y1},{x2,y2}}});
                }
        }
        sort(all(vp));
        int val=0;
        forr(i,0,sz(vp)){
                int cnt=0;
                if(mpp[i]==0)
                forr(j,i+1,sz(vp)){
                        ldd m=vp[j].F;
                        if(m==vp[i].F&&(m*vp[i].S.F.F-vp[i].S.F.S+vp[j].S.F.S-m*vp[j].S.F.F==0||m*vp[i].S.S.F-vp[i].S.S.S+vp[j].S.F.S-m*vp[j].S.F.F==0)){
                                cnt++;
                                mpp[j]++;
                        }
                }
                val+=cnt-1;
        }
        map<ldd,int>mp1;
        int cnt=0;
        forr(i,0,sz(vp)) {
                if (mpp[i] < 1) {
                        cnt++;
                        mp1[vp[i].F]++;
                }
        }
        n=(cnt*(cnt-1))/2;
        int ans=0;
        for(auto vbn:mp1){
                ans+=(vbn.S*(vbn.S-1))/2;
        }
        print(n-ans);
}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

signed main() {
        ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
        freopen("output.txt", "w", stdout);
#endif
        int tin = 1; //input(tin);
        while (tin--) {
                stand8th();
        }
        return 0;
}


//*//

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define elif else if
#define mp make_pair
#define int long long
#define ldd long double
#define vec_i vector<int>
#define pair_i pair<int,int>
#define sz(x) (int)(x.size())
#define vec_p vector<pair<int,int>>
#define vec_vec vector<vector<int>>
#define all(x) (x).begin(),(x).end()

#define forr(x,a,m) for(int x=a;x<m;x+=1)
#define debug(x) cout<<"~~"<<#x<<" => "<<x<<endl;

bool rev(int x, int y) {return x > y;}
void input_arr(int a[], int n) {forr(i, 0, n) cin >> a[i];}
bool sortbysec(const pair_i &a, const pair_i &b) {return a.S < b.S;}
bool sortinrev(const pair_i &a, const pair_i &b) {return (a.F > b.F);}
void print_vec(vec_i &v) {for (auto i : v) cout << i << " "; cout << endl;}
bool sortinrevbysec(const pair_i &a, const pair_i &b) {return (a.S > b.S);}
void print_arr(int a[], int n) {forr(i, 0, n)cout << a[i] << " "; cout << endl;}

template<typename...T>void input(T &...args) {((cin >> args), ...);}
template<typename...T>void print(T &&...args) {((cout << args << endl), ...);}
template<typename...T>void deb(T &&...args) {cout << "~~ "; ((cout << args << " "), ...); cout << endl;}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

void stand8th() {
        int n; input(n);
        vec_p points; int x,y;
        forr(i,0,n){
                input(x,y);
                points.emplace_back(x,y);
        }
        map<pair_i,set<int>>lines;
        forr(i,0,n){
                forr(j,i+1,n){
                        int x1=points[i].F; int y1=points[i].S;
                        int x2=points[j].F; int y2=points[j].S;
                        int a=(x1-x2); int b=(y1-y2);
                        int g=__gcd(a,b);
                        a=a/g; b=b/g;
                        if(a<0||(a==0&&b<0)){
                                a*=-1; b*=-1;
                        }
                        int c=((-a*y1+b*x1));
                        lines[{a,b}].insert(c);
                }
        }
        int ans=0,val=0;
        for(auto vbn:lines){
                val+=sz(vbn.S);
        }
        for(auto vbn:lines){
                val-=sz(vbn.S);
                ans+=sz(vbn.S)*val;
        }
        print(ans);
}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

signed main() {
        ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifndef ONLINE_JUDGE
        freopen("output.txt", "w", stdout);
#endif

        int tin = 1; //input(tin);
        while (tin--) {
                stand8th();
        }
        return 0;
}


//*//

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define elif else if
#define mp make_pair
#define int long long
#define ldd long double
#define vec_i vector<int>
#define pair_i pair<int,int>
#define sz(x) (int)(x.size())
#define vec_p vector<pair<int,int>>
#define vec_vec vector<vector<int>>
#define all(x) (x).begin(),(x).end()

#define forr(x,a,m) for(int x=a;x<m;x+=1)
#define debug(x) cout<<"~~"<<#x<<" => "<<x<<endl;

bool rev(int x, int y) {return x > y;}
void input_arr(int a[], int n) {forr(i, 0, n) cin >> a[i];}
bool sortbysec(const pair_i &a, const pair_i &b) {return a.S < b.S;}
bool sortinrev(const pair_i &a, const pair_i &b) {return (a.F > b.F);}
void print_vec(vec_i &v) {for (auto i : v) cout << i << " "; cout << endl;}
bool sortinrevbysec(const pair_i &a, const pair_i &b) {return (a.S > b.S);}
void print_arr(int a[], int n) {forr(i, 0, n)cout << a[i] << " "; cout << endl;}

template<typename...T>void input(T &...args) {((cin >> args), ...);}
template<typename...T>void print(T &&...args) {((cout << args << endl), ...);}
template<typename...T>void deb(T &&...args) {cout << "~~ "; ((cout << args << " "), ...); cout << endl;}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

void stand8th() {
        int n; input(n);
        vec_p points; int x,y;
        forr(i,0,n){
                input(x,y);
                points.emplace_back(x,y);
        }
        vec_vec lines;
        forr(i,0,n){
                forr(j,i+1,n){
                        int x1=points[i].F; int y1=points[i].S;
                        int x2=points[j].F; int y2=points[j].S;
                        int a=(y2-y1); int b=(x1-x2);
                        int g=__gcd(a,b);
                        a=a/g; b=b/g;
                        if(a<0||(b==0&&a<0)){
                                a*=-1; b*=-1;
                        }
                        int c=((b*y1-a*x1));
                        lines.pb({a,b,c});
                }
        }
        map<int,int>mpp;
        map<pair_i,int>f;
        forr(i,0,sz(lines)){
                int cnt=0;
                if(mpp[i]!=-1) {
                        f[{lines[i][0],lines[i][1]}]++;
                        forr(j, i + 1, sz(lines)) {
                                if (lines[i]==lines[j]) {
                                        mpp[j] = -1;
                                        cnt++;
                                }
                        }
                }
        }
        int ans=0,val=0;
        for(auto vbn:f){
                ans+=((vbn.S-1)*(vbn.S))/2;
                val+=vbn.S;
        }
        val=(val*(val-1))/2;
        val-=ans;
        print(val);
}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

signed main() {
        ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifndef ONLINE_JUDGE
        freopen("output.txt", "w", stdout);
#endif

        int tin = 1; //input(tin);
        while (tin--) {
                stand8th();
        }
        return 0;
}


//*//

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define elif else if
#define mp make_pair
#define int long long
#define ldd long double
#define vec_i vector<int>
#define pair_i pair<int,int>
#define sz(x) (int)(x.size())
#define vec_p vector<pair<int,int>>
#define vec_vec vector<vector<int>>
#define all(x) (x).begin(),(x).end()

#define forr(x,a,m) for(int x=a;x<m;x+=1)
#define debug(x) cout<<"~~"<<#x<<" => "<<x<<endl;

bool rev(int x, int y) {return x > y;}
void input_arr(int a[], int n) {forr(i, 0, n) cin >> a[i];}
bool sortbysec(const pair_i &a, const pair_i &b) {return a.S < b.S;}
bool sortinrev(const pair_i &a, const pair_i &b) {return (a.F > b.F);}
void print_vec(vec_i &v) {for (auto i : v) cout << i << " "; cout << endl;}
bool sortinrevbysec(const pair_i &a, const pair_i &b) {return (a.S > b.S);}
void print_arr(int a[], int n) {forr(i, 0, n)cout << a[i] << " "; cout << endl;}

template<typename...T>void input(T &...args) {((cin >> args), ...);}
template<typename...T>void print(T &&...args) {((cout << args << endl), ...);}
template<typename...T>void deb(T &&...args) {cout << "~~ "; ((cout << args << " "), ...); cout << endl;}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

void stand8th() {
        int n; input(n);
        vec_p points; int x,y;
        forr(i,0,n){
                input(x,y);
                points.emplace_back(x,y);
        }
        map<pair_i,set<int>>lines;
        forr(i,0,n){
                forr(j,i+1,n){
                        int x1=points[i].F; int y1=points[i].S;
                        int x2=points[j].F; int y2=points[j].S;
                        int a=(y2-y1); int b=(x1-x2);
                        int g=__gcd(a,b);
                        a=a/g; b=b/g;
                        if(a<0||(b==0&&a<0)){
                                a*=-1; b*=-1;
                        }
                        int c=((b*y1-a*x1));
                        lines[{a,b}].insert(c);
                }
        }
        int ans=0,val=0;
        for(auto vbn:lines){
                val+=sz(vbn.S);
        }
        for(auto vbn:lines){
                val-=sz(vbn.S);
                ans+=sz(vbn.S)*val;
        }
        print(ans);
}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

signed main() {
        ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifndef ONLINE_JUDGE
        freopen("output.txt", "w", stdout);
#endif

        int tin = 1; //input(tin);
        while (tin--) {
                stand8th();
        }
        return 0;
}


//*//

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define elif else if
#define mp make_pair
#define int long long
#define ldd long double
#define vec_i vector<int>
#define pair_i pair<int,int>
#define sz(x) (int)(x.size())
#define vec_vec vector<vector<int>>
#define vec_p vector<pair<int,int>>
#define all(x) (x).begin(),(x).end()

#define forr(x,a,m) for(int x=a;x<m;x+=1)
#define debug(x) cout<<"~~"<<#x<<" => "<<x<<endl;

bool sortbysec(const pair_i &a, const pair_i &b) {return a.S < b.S;}
bool sortinrev(const pair_i &a, const pair_i &b) {return (a.F > b.F);}
bool rev(int x, int y) {return x > y;}
bool sortinrevbysec(const pair_i &a, const pair_i &b) {return (a.S > b.S);}
void input_arr(int a[], int n) {forr(i, 0, n) cin >> a[i];}
void print_vec(vec_i &v) {for (auto i : v) cout << i << " "; cout << endl;}
void print_arr(int a[], int n) {forr(i, 0, n)cout << a[i] << " "; cout << endl;}

template<typename...T>void input(T &...args) {((cin >> args), ...);}
template<typename...T>void print(T &&...args) {((cout << args << endl), ...);}
template<typename...T>void deb(T &&...args) {cout << "~~ "; ((cout << args << " "), ...); cout << endl;}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

void stand8th() {
        int n; input(n);
        int x,y; vec_p v;
        forr(i,0,n){
                input(x,y);
                v.emplace_back(x,y);
        }
        vec_i v1; map<ldd,int>mpp;
        vector<pair<int,pair<pair_i,pair_i>>> vp;
        forr(i,0,n){
                forr(j,i+1,n){
                        ldd x1=v[i].F,x2=v[j].F,y1=v[i].S,y2=v[j].S;
                        ldd m;
                        if(x2-x1==0) m=INT64_MAX;
                        else m=((ldd)(y2-y1))/((ldd)(x2-x1));
                        vp.pb({m,{{x1,y1},{x2,y2}}});
                        mpp[m]++;
                }
        }
        sort(all(vp));
        int cnt=0; int val=0;
        map<int,int>vpvp;
        forr(i,0,sz(vp)){
                cnt=0;
                if(vpvp[i]==0)
                forr(j,i+1,sz(vp)){
                        if(vp[i].F==vp[j].F&&(vp[i].S.F==vp[j].S.F||vp[i].S.F==vp[j].S.S||vp[i].S.S==vp[j].S.F||vp[i].S.S==vp[j].S.S)){
                                cnt++;
                                mpp[vp[i].F]--;
                                vpvp[j]++;
                        }
                }
                val+=cnt;
        }
        int ans=0;
        for(auto vbn:mpp){
                ans+=(vbn.S*(vbn.S-1))/2;
        }
        n=(n*(n-1))/2-val;
        int f=0;
        print(max((n*(n-1))/2-ans,f));
}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

signed main() {
        ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
        freopen("output.txt", "w", stdout);
#endif
        int tin = 1; //input(tin);
        while (tin--) {
                stand8th();
        }
        return 0;
}


//*//

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define elif else if
#define mp make_pair
#define int long long
#define ldd long double
#define vec_i vector<int>
#define pair_i pair<int,int>
#define sz(x) (int)(x.size())
#define vec_p vector<pair<int,int>>
#define vec_vec vector<vector<int>>
#define all(x) (x).begin(),(x).end()

#define forr(x,a,m) for(int x=a;x<m;x+=1)
#define debug(x) cout<<"~~"<<#x<<" => "<<x<<endl;

bool rev(int x, int y) {return x > y;}
void input_arr(int a[], int n) {forr(i, 0, n) cin >> a[i];}
bool sortbysec(const pair_i &a, const pair_i &b) {return a.S < b.S;}
bool sortinrev(const pair_i &a, const pair_i &b) {return (a.F > b.F);}
void print_vec(vec_i &v) {for (auto i : v) cout << i << " "; cout << endl;}
bool sortinrevbysec(const pair_i &a, const pair_i &b) {return (a.S > b.S);}
void print_arr(int a[], int n) {forr(i, 0, n)cout << a[i] << " "; cout << endl;}

template<typename...T>void input(T &...args) {((cin >> args), ...);}
template<typename...T>void print(T &&...args) {((cout << args << endl), ...);}
template<typename...T>void deb(T &&...args) {cout << "~~ "; ((cout << args << " "), ...); cout << endl;}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

void stand8th() {
        int n; input(n);
        vec_p points; int x,y;
        forr(i,0,n){
                input(x,y);
                points.emplace_back(x,y);
        }
        vec_vec lines;
        forr(i,0,n){
                forr(j,i+1,n){
                        int x1=points[i].F; int y1=points[i].S;
                        int x2=points[j].F; int y2=points[j].S;
                        int a=(x1-x2); int b=(y1-y2);
                        int g=__gcd(a,b);
                        a=a/g; b=b/g;
                        if(a<0||(a==0&&b<0)){
                                a*=-1; b*=-1;
                        }
                        int c=((-a*y1+b*x1));
                        lines.pb({a,b,c});
                }
        }
        map<int,int>mpp;
        map<pair_i,int>f;
        forr(i,0,sz(lines)){
                int cnt=0;
                if(mpp[i]!=-1) {
                        f[{lines[i][0],lines[i][1]}]++;
                        forr(j, i + 1, sz(lines)) {
                                if (lines[i]==lines[j]) {
                                        mpp[j] = -1;
                                        cnt++;
                                }
                        }
                }
        }
        int ans=0,val=0;
        for(auto vbn:f){
                ans+=((vbn.S-1)*(vbn.S))/2;
                val+=vbn.S;
        }
        val=(val*(val-1))/2;
        val-=ans;
        print(val);
}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

signed main() {
        ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifndef ONLINE_JUDGE
        freopen("output.txt", "w", stdout);
#endif

        int tin = 1; //input(tin);
        while (tin--) {
                stand8th();
        }
        return 0;
}


// Codeforces Round #667 (Div. 3)

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define elif else if
#define mp make_pair
#define int long long
#define ldd long double
#define vec_i vector<int>
#define pair_i pair<int,int>
#define sz(x) (int)(x.size())
#define vec_vec vector<vector<int>>
#define vec_p vector<pair<int,int>>
#define all(x) (x).begin(),(x).end()

#define forr(x,a,m) for(int x=a;x<m;x+=1)
#define debug(x) cout<<"~~"<<#x<<" => "<<x<<endl;

bool sortbysec(const pair_i &a, const pair_i &b) {return a.S < b.S;}
bool sortinrev(const pair_i &a, const pair_i &b) {return (a.F > b.F);}
bool rev(int x, int y) {return x > y;}
bool sortinrevbysec(const pair_i &a, const pair_i &b) {return (a.S > b.S);}
void input_arr(int a[], int n) {forr(i, 0, n) cin >> a[i];}
void print_vec(vec_i &v) {for (auto i : v) cout << i << " "; cout << endl;}
void print_arr(int a[], int n) {forr(i, 0, n)cout << a[i] << " "; cout << endl;}

template<typename...T>void input(T &...args) {((cin >> args), ...);}
template<typename...T>void print(T &&...args) {((cout << args << endl), ...);}
template<typename...T>void deb(T &&...args) {cout << "~~ "; ((cout << args << " "), ...); cout << endl;}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

void stand8th() {
        int n; input(n);
        int x,y; vec_p v;
        forr(i,0,n){
                input(x,y);
                v.emplace_back(x,y);
        }
        vector<pair<pair_i,int>> lines,lines_two;
        vector<pair<pair_i,pair_i>> points;
        forr(i,0,n){
                forr(j,i+1,n){
                        int a=v[i].S-v[j].S;
                        int b=v[j].F-v[i].F;
                        int c=(-1*a+1)*v[j].F-v[i].F;
                        lines.pb({{a,b},c});
                        points.pb({{v[i].F,v[i].S},{v[j].F,v[j].S}});
                }
        }
        map<int,int>mpp;
        forr(i,0,sz(lines)){
                if(mpp[i]==0) {
                        forr(j, i + 1, sz(lines)) {
                                if(lines[i].F.F*lines[j].F.S==lines[i].F.S*lines[j].F.F){
                                        int x1=points[i].F.F; int x2=points[i].S.F;
                                        int y1=points[i].S.F; int y2=points[i].S.S;
                                        if((lines[j].F.F*x1+lines[j].F.S*y1+lines[j].S==0)||(lines[j].F.F*x2+lines[j].F.S*y2+lines[j].S==0)){
                                                mpp[j]++;
                                        }
                                }
                        }
                }
        }
        forr(i,0,sz(lines)){
                if(mpp[i]<=0){
                        lines_two.pb(lines[i]);
                }
        }
        lines.clear();
        map<int,int>prll;
        int ans=0;
        forr(i,0,sz(lines_two)){
                if(prll[i]==0) {
                        int cnt=1;
                        forr(j, i + 1, sz(lines_two)) {
                                if(lines_two[i].F.F*lines_two[j].F.S==lines_two[i].F.S*lines_two[j].F.F){
                                        prll[j]++;
                                        cnt++;
                                }
                        }
                        ans-=(cnt*(cnt-1))/2;
                }
        }
        ans+=(sz(lines_two)*(sz(lines_two)-1))/2;
        print(ans);
}

// ~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.-.~.

signed main() {
        ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifndef ONLINE_JUDGE
        freopen("output.txt", "w", stdout);
#endif

        int tin = 1; //input(tin);
        while (tin--) {
                stand8th();
        }
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long A[200009];
long long x[200009];
long long y[200009];
struct line
{
  long long slopea,slopeb;
  long long ya,yb;
};
bool cmp(const line &a,const line &b)
{
  if(a.slopea * b.slopeb != a.slopeb * b.slopea)
  {
    return a.slopea * b.slopeb < a.slopeb * b.slopea;
  }
  return a.ya * b.yb < a.yb * b.ya;
}
bool cmp1(const line &a,const line &b)
{
  return a.ya < b.ya;
}
bool cmp2(const line &a,const line &b)
{
  return a.ya < b.yb;
}
bool same(line a,line b)
{
  return(a.slopea == b.slopea && a.slopeb == b.slopeb && a.ya == b.ya && a.yb == b.yb);
}
bool same1(line a,line b)
{
  return(a.slopea == b.slopea && a.slopeb == b.slopeb);
}
int main()
{
  long long M,i,j,k,N,now,ans,before;
  vector<line> temp;
  vector<line> hor;
  vector<line> ver;
  vector<line> temps;
  vector<line> hors;
  vector<line> vers;
  line t;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  for(i = 0;i < N;i++)
  {
    cin >> x[i] >> y[i];
  }
  for(i = 0;i < N;i++)
  {
    for(j = i+1;j < N;j++)
    {
      if(x[i] == x[j])
      {
        t.slopea = -1;
        t.slopeb = 0;
        t.ya = x[i];
        t.yb = 1;
        ver.push_back(t);
      }
      else if(y[i] == y[j])
      {
        t.slopea = 0;
        t.slopeb = 1;
        t.ya = y[i];
        t.yb = 1;
        hor.push_back(t);
      }
      else
      {
        t.slopea = y[j] - y[i];
        t.slopeb = t.yb = x[j] - x[i];
        t.ya = x[j]*y[i] - x[i]*y[j];
        k = __gcd(abs(t.slopea),abs(t.slopeb));
        t.slopea /= k;
        t.slopeb /= k;
        if(t.slopeb < 0)
        {
          t.slopea *= -1;
          t.slopeb *= -1;
        }
        k = __gcd(abs(t.ya),abs(t.yb));
        t.ya /= k;
        t.yb /= k;
        if(t.yb < 0)
        {
          t.ya *= -1;
          t.yb *= -1;
        }
        temp.push_back(t);
      }
    }
  }
  sort(temp.begin(),temp.end(),cmp);
  sort(ver.begin(),ver.end(),cmp1);
  sort(hor.begin(),hor.end(),cmp2);
  return 0;
  //system("pause");
  for(i = 0;i < temp.size();i++)
  {
    i++;
    while(i < temp.size() && same(temp[i],temp[i-1]))
      i++;
    temps.push_back(temp[i-1]);
    i--;
  }
  for(i = 0;i < ver.size();i++)
  {
    i++;
    while(i < ver.size() && same(ver[i],ver[i-1]))
      i++;
    vers.push_back(ver[i-1]);
    i--;
  }
  for(i = 0;i < hor.size();i++)
  {
    i++;
    while(i < hor.size() && (same(hor[i],hor[i-1])))
      i++;
    hors.push_back(hor[i-1]);
    i--;
  }
  //cout  << temp.size() << " " << hor.size() << " " << ver.size() <<endl;
  //cout  << temps.size() << " " << hors.size() << " " << vers.size() <<endl;
  ans = (long long)temps.size() * (long long)hors.size() + (long long)temps.size()*(long long)vers.size() +(long long)vers.size()*(long long)hors.size();
  before = 0;
  for(i = 0;i < temps.size();i++)
  {
    now = 1;
    i++;
    while(i < temps.size() && same1(temps[i],temps[i-1]))
    {
      //cout << "hhh" <<endl;
      now++;
    }
    ans += now*before;
    //cout << i << " " << now << " " << before <<endl;
    i--;
    before += now;
  }
  cout << ans <<endl;
}