$%=<>;++$h{$x+=$_}for 1..5e3;print$h{$%}?1:grep($h{$%-$_},%h)?2:3