#include <iostream>

using namespace std; 

int main () {
    
    ios_base::sync_with_stdio(false); 
    cin.tie(0); 
    cout.tie(0); 
    
    int n;  
    
    cin>>n; 
    
    double k[n];
    int s[n];
    
    for(int i = 0 ; i < n ; i++) {
        
        int x, y; 
        
        cin>>x>>y; 
        
        k[i] = y/(double)x;  
        
        if(x > 0 && y > 0) { s[i] = 1;  continue; }
        if(x > 0) { s[i] = 4;  continue; }
        if(y > 0) { s[i] = 2; continue; } 
        s[i] = 3;

    }
    
    int br = 0; 
    
    for(int i = 0 ; i < n ; i++) {
        
        for(int j = i+1 ; j < n ; j++) {
            
            if(k[i] == k[j] && s[i] != s[j]) { br++; }
            
        }
        
    }
    
    if(br == 0) { cout<<0; return 0; }
    cout<<2;
    
    return 0; 
    
}