#include<cstdio>
#include<cstring>
#include<algorithm>
#define LL long long
using std::sort;
const int M=2e5+7,inf=0x3f3f3f3f;
int read(){
int ans=0,f=1,c=getchar();
while(c<‘0‘||c>‘9‘){if(c==‘-‘) f=-1; c=getchar();}
while(c>=‘0‘&&c<=‘9‘){ans=ans*10+(c-‘0‘); c=getchar();}
return ans*f;
}
int n;
struct pos{int x,y,wh; double k;}q[M];
bool cmp(pos a,pos b){return a.wh!=b.wh?a.wh<b.wh:a.k>b.k;}
int main(){
int x,y;
n=read();
for(int i=1;i<=n;i++){
x=read(); y=read();
q[i].x=x; q[i].y=y;
if(x) q[i].k=1.0*y/x; else q[i].k=-inf;
if(x>0&&y>=0) q[i].wh=1;
else if(x>=0&&y<0) q[i].wh=2;
else if(x<0&&y<=0) q[i].wh=3;
else q[i].wh=4;
}
LL ans=1LL*n*(n-1)*(n-2)/6;
sort(q+1,q+1+n,cmp);
LL sum=1,ly=2;
for(int i=1;i<=n;i++){
sum--;
while(1LL*q[ly].y*q[i].x<1LL*q[i].y*q[ly].x){
ly++; sum++;
if(ly>n) ly-=n;
}
ans=ans-sum*(sum-1)/2;
}
printf("%lld\n",ans);
return 0;
}