In 2222, human has been highly developed in space. There are a lot of bases in the space. It was found that linking these bases is more conducive to human's development. Therefore, We need to calculate that the minimum number of roads we should build to connect all the bases, either connecting directly or not directly.
Print the number of road in one line.