The degrees of freedom refers to the number of independent observations in a set of data.
Since the standard deviation of the set of data is constant, if you have (n-1) data out of the total n ones, you already got the whole data set. So that's why degree of freedom is n-1.