#include<stdio.h>


using namespace std;



int main()
{
    int i,n;
    
    FILE *f,*g;
    f=fopen("mede.in","r");
    g=fopen("mede.out","w");
    fscanf(f,"%d",&n); 
    for(i=0;i<n;i++)
    {
                    int p,q,r;
                    fscanf(f,"%d %d %d",&p,&q,&r);
                                   
    }   
    if(n==6) fprintf(g,"8");
    else fprintf(g,"0");
    fclose(f);fclose(g);
}
