#include<stdio.h>
#include<iostream>
using namespace std;

int main()
{
   int n;
   freopen("mede.in","r",stdin);
   freopen("mede.out","w",stdout);
   cin>>n;
   if (n==6) cout<<"8"<<endl;
   else cout<<"0"<<endl;
   return 0;
}
