def f l
$d[l]||=($a-l).map{|i|l.all?{|j|$c[i].member? j}?f((l+[i]).sort):l.size}.max
end
while gets[0]>?0
$d={}
$a=(0..$_.to_i-1).to_a
b=$a.map{eval"[#{gets}]"}
$c=$a.map{|i|[i]}
$a.combination(2).map{|i,j|Math.hypot(*b[i].zip(b[j]).map{|i,j|i-j})<2&&$c[i]<<j&&$c[j]<<i}
p f([])
end