#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
struct POINT{ int x, y, id; };
POINT P[100001], temp, mid;
stack<POINT> S;
int t, t2, n, m = 0x7fffffff, mi, DT[100001], flag, p = 0, ones, twos, os, ts, ans = 0x7fffffff;
int area(POINT a, POINT b, POINT c)
{
    return a.x*b.y + b.x*c.y + c.x*a.y
            - b.x*a.y - c.x*b.y - a.x*c.y;
}
int dist(POINT a, POINT b)
{
    return (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}
bool cmp(const POINT& a, const POINT& b)
{
    if( area(P[0],a,b) < area(P[0],b,a) == 0 ) { puts("fail!!"); exit(0); }
    return area(P[0],a,b) < area(P[0],b,a);
}
int main()
{
    freopen(".20.in","r",stdin);
    freopen(".20.out","w",stdout);
    scanf("%d", &n);
    for(int i = 0 ; i < n ; i++ )
    {
        scanf("%d%d%d",&P[i].id,&P[i].x,&P[i].y);
        if( m > P[i].y ) m = P[i].y, mi = i;
    }
    temp = P[mi], P[mi] = P[0], P[0] = temp;
    sort(P+1, P+n, cmp);
    S.push(P[0]), S.push(P[1]);
    for(int i = 2 ; i < n ; i++ )
    {
        temp = S.top(), S.pop();
        while( !S.empty() && area(S.top(), temp, P[i]) > 0 ) temp=S.top(), S.pop();
        S.push(temp), S.push(P[i]);
    }
    while( !S.empty() ) DT[p++] = S.top().id, S.pop(), DT[p-1]==1?ones++:twos++;
    ans = min(ans, min(t = ones,t2 = twos));
    for(os = 0 ; os < p && DT[os]==2 ; os++ );
    for(ts = 0 ; ts < p && DT[ts]==1 ; ts++ );
    for(int i = os ; i < p+os ; i++ )
    {
        if( DT[i%p] == 2 ) twos--, ones++;
        else twos++, ones--;
        ans = min(ans, min(ones, twos));
    }
    for(int i = ts ; i < p+ts ; i++ )
    {
        if( DT[i%p] == 2 ) t2--, t++;
        else t2++, t--;
        ans = min(ans, min(t2, t));
    }
    if( ans ) printf("%d", ans);
    else puts("OK");
}
