n,*a=*$<;p (0..99).one?{|i|a.one?{|b|/^(\S+ ){#{i}}nyanpass/!~b}&&X=i}?X+1:-1