1 #include<cstdio>
2 #include<cstring>
3 #include<iostream>
4 #include<algorithm>
5 #include<cmath>
6 #include<cassert>
7 #define inf 1e10
8 #define maxn 200005
9 using namespace std;
10 int n,head,tail,tot;
11 const double eps=1e-15;
12 struct point{double x,y;};
13 point operator +(point x,point y){return (point){x.x+y.x,x.y+y.y};}
14 point operator -(point x,point y){return (point){x.x-y.x,x.y-y.y};}
15 struct line{double ang,a,b,c;int id;point pt;}li[maxn],que[maxn];
16 double dot(point a,point b){return a.x*b.x+a.y*b.y;}
17 bool includ(line x,point y){return dot(y-x.pt,(point){x.a,x.b})>=-eps;}
18 bool comp(line x,line y){
19 if(x.ang==y.ang)return includ(y,x.pt);
20 return x.ang<y.ang;
21 }
22 point calc(line s1,line s2){
23 double v1=s1.b*s2.c-s1.c*s2.b,v2=s1.c*s2.a-s1.a*s2.c;
24 double v0=s1.a*s2.b-s1.b*s2.a;
25 return (point){v1/v0,v2/v0};
26 }
27 bool check(line x,line y,line z){return !includ(z,calc(x,y));}
28 bool solve(int lim){
29 head=1;tail=0;int cnt=0;
30 for(int i=1;i<=tot;i++){
31 if(li[i].id>lim)continue;
32 if(i>1&&fabs(li[i].ang-li[i-1].ang)<=eps)continue;cnt++;
33 while(head<tail&&check(que[tail-1],que[tail],li[i]))tail--;
34 while(head<tail&&check(que[head],que[head+1],li[i]))head++;
35 que[++tail]=li[i];
36 }
37 while(head<tail&&check(que[tail-1],que[tail],que[head]))tail--;
38 while(head<tail&&check(que[head],que[head+1],que[tail]))head++;
39 return tail-head+1>=3;
40 }
41 int main(){
42 scanf("%d",&n);
43 for(int i=1;i<=n;i++){
44 double x,y,z;
45 scanf("%lf%lf%lf",&x,&y,&z);
46 li[++tot].a=x*x;li[tot].b=x;li[tot].c=-y;li[tot].id=i;
47 li[++tot].a=-x*x;li[tot].b=-x;li[tot].c=z;li[tot].id=i;
48 }
49 ++tot,li[tot].a=-1,li[tot].b=0,li[tot].c=0,li[tot].id=-1;
50 ++tot,li[tot].a=1,li[tot].b=0,li[tot].c=inf,li[tot].id=-1;
51 ++tot,li[tot].a=0,li[tot].b=1,li[tot].c=0,li[tot].id=-1;
52 ++tot,li[tot].a=0,li[tot].b=-1,li[tot].c=inf,li[tot].id=-1;
53 for(int i=1;i<=tot;i++){
54 li[i].ang=atan2(li[i].b,li[i].a);
55 if(li[i].b) li[i].pt=(point){0,-li[i].c/li[i].b};
56 else li[i].pt=(point){-li[i].c/li[i].a,0};
57 }
58 sort(li+1,li+tot+1,comp);
59 int l=1,r=n,mid;
60 while(l<=r){
61 mid=(l+r)>>1;
62 if(solve(mid))l=mid+1;
63 else r=mid-1;
64 }
65 printf("%d\n",r);
66 return 0;
67 }