#include<bits/stdc++.h>
using namespace std;
int N,A,B,AB,O,a,b,o,ab,m,ost;
int c;
int main(){
    cin>>N;
    for(int i=1;i<=N;i++){
        cin>>c>>m;
    }
    if(N<4)cout<<0<<endl;
    else cout<<1<<endl;

    return 0;
}