sub f{ map{ / (.*) /; push@{$`},"$1 $'"; push@$1,"$` $'" }<>; my$r=1; $r+=$t=!$c[$_]++&&&f,$\+=$t*($N-$t)*/ /*$'*2for@{$_+0}; $r } f for$N=<>; print