How many ways are there to paint each of the integers $2$, $3$, $\cdots$, $9$ either red, green, or blue so that each number has a different color from each of its proper divisors?