#include<iostream>

using namespace std;

double paralelnost(double x1, double y1, double x2, double y2){
	return (y2 - y1) / (x2 - x1);
}

int main(){
	int br_takmicara;
	cin>>br_takmicara;
	int tacke[4][2];    
	for (int i = 0; i < br_takmicara; i++){
		cin>>tacke[i][0]>>tacke[i][1];
	}
	if (paralelnost(tacke[0][0], tacke[0][1], tacke[1][0], tacke[1][1]) == paralelnost(tacke[3][0], tacke[3][1], tacke[4][0], tacke[4][1])){
		cout<<"\n1";
	}
	else if (paralelnost(tacke[0][0], tacke[0][1], tacke[3][0], tacke[3][1]) == paralelnost(tacke[2][0], tacke[2][1], tacke[4][0], tacke[4][1])){
		cout<<"\n1";
	}
	else if (paralelnost(tacke[0][0], tacke[0][1], tacke[4][0], tacke[4][1]) == paralelnost(tacke[2][0], tacke[2][1], tacke[3][0], tacke[3][1])){
		cout<<"\n1";
	}
	else{
		cout<<"0";
	}
}