import math;n=int(input());P=lambda p:0 if(g:=math.gcd(p,n))<3 and g