#include <bits/stdc++.h>
#define ff(i, a, b) for(int(i)=a; (i)<b; (i)++)
#define fb(i, a, b) for(int(i)=a; (i)>b; (i)--)
#define vt vector
#define pb push_back
#define ll long long
#define ull unsigned long long
#define bn "\n"
#define sp " "

using namespace std;

const int mxN = 1e5+7;

struct koordinate{
    ll x, y;
};

struct koordinate k[mxN];

void solve(){
    int n; cin >> n;
    ff(i, 0, n){
        cin >> k[i].x >> k[i].y;
    }

    int ans = 0;

    bool jst = false;
    int j;
    if(n==3){
        ff(i, 0, 3){
            if(k[i].x==0 && k[i].y==0){
                ans++; jst=true;
            }
        }
        ff(i, 0, 3){
            if(i==2){j=0;}
            else{j = i+1;}
            if ( ( (0 - k[i].y) * (k[j].x - k[i].x) == (0 - k[i].x) * (k[j].y - k[i].y) ) && max(k[i].x, k[j].x)>=0 && min(k[i].x, k[j].x)<=0 && max(k[i].y, k[j].y)>=0 && min(k[i].y, k[j].y)<=0 ){
                ans++; jst=true;
            }
        }
        if(jst==true){ans++;}
        cout << ans << bn;
    }

}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cerr.tie(0);
    solve();
    return 0;
}