#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long double ld;
const int maxn=500010;
const ld eps=1e-18;
struct point
{
ld x,y;
point() {}
point(ld a,ld b) {x=a,y=b;}
point operator + (const point &a) const {return point(x+a.x,y+a.y);}
point operator - (const point &a) const {return point(x-a.x,y-a.y);}
point operator * (const ld &a) const {return point(x*a,y*a);}
ld operator * (const point &a) const {return x*a.y-y*a.x;}
};
struct line
{
point p,v;
ld a;
line() {}
line(point x,point y){p=x,v=y,a=atan2(v.y,v.x);}
}l[maxn];
int n,tot,h,t;
ld x[maxn],y[maxn],z[maxn];
int q[maxn];
inline point getp(line l1,line l2)
{
point u=l1.p-l2.p;
ld temp=(l2.v*u)/(l1.v*l2.v);
return l1.p+l1.v*temp;
}
inline bool onlft(line a,point b)
{
return a.v*(b-a.p)>0;
}
inline bool cmp(const line &a,const line &b)
{
if(fabs(a.a-b.a)==0) return !onlft(a,b.p);
return a.a<b.a;
}
void HPI()
{
sort(l+1,l+tot+1,cmp);
int i,cnt;
for(i=2,cnt=1;i<=tot;i++) if(fabs(l[i].a-l[cnt].a)>0) l[++cnt]=l[i];
h=t=q[1]=1;
for(i=2;i<=cnt;i++)
{
while(h<t&&!onlft(l[i],getp(l[q[t]],l[q[t-1]]))) t--;
while(h<t&&!onlft(l[i],getp(l[q[h]],l[q[h+1]]))) h++;
q[++t]=i;
}
while(h<t&&!onlft(l[q[h]],getp(l[q[t]],l[q[t-1]]))) t--;
}
bool check(int now)
{
tot=0;
int i;
for(i=1;i<=now;i++)
l[++tot]=line(point(0,y[i]/x[i]-eps),point(1,-x[i])),l[++tot]=line(point(0,z[i]/x[i]+eps),point(-1,x[i]));
l[++tot]=line(point(-eps,eps),point(eps,1e10)),l[++tot]=line(point(-1e10,eps),point(1e10,2*eps)),
l[++tot]=line(point(-1e10,1e10),point(-3*eps,-1e10)),l[++tot]=line(point(-eps,1e10),point(-1e10,4*eps));
HPI();
return t-h+1>=3;
}
inline int rd()
{
int ret=0,f=1; char gc=getchar();
while(gc<‘0‘||gc>‘9‘) {if(gc==‘-‘)f=-f; gc=getchar();}
while(gc>=‘0‘&&gc<=‘9‘) ret=ret*10+gc-‘0‘,gc=getchar();
return ret*f;
}
int main()
{
//freopen("bz2732.in","r",stdin);
n=rd();
int i;
for(i=1;i<=n;i++) scanf("%Lf%Lf%Lf",&x[i],&y[i],&z[i]),y[i]+=eps,z[i]-=eps;
int l=1,r=n+1,mid;
while(l<r)
{
mid=(l+r)>>1;
if(check(mid)) l=mid+1;
else r=mid;
}
printf("%d",l-1);
return 0;
}//1 1 1 2