x=0 while 1:x=[x,0][x in[-1,256]];exec"1 x+=1 print+x x*=x x-=1".split()[ord(raw_input())%8%5]