If the mean and variance of a binomial distribution are \( 18 \) and \( 12 \) respectively, then the value of \( n \) is __________.