They have just defined the basic formula of S² first(sample variance). But solved the given equation by taking the RHS of it.