2 ){ $ans += $node[$a] - 2; } if ( ++$node[$b] > 2 ){ $ans += $node[$b] - 2; } } print $ans."\n";