require'prime' d=0,*[-1]*n=gets.to_i Prime.each(999){|p|n.downto(p){|i|t=d[i-p]+1;t>0&&d[i]