var
 n:integer;
 f,g:text;
begin
 assign(f,'mede.in');
 reset(f);
 assign(g,'mede.out');
 rewrite(g);
  readln(f,n);
  if n=6 then
   writeln(g,'8')
    else
     writeln(g,'0');
close(f);
close(g);
end.