Let $n>1$ be an integer. In the space, consider the set $S=\{(x,y,z)\mid x,y,z\in\{0,1,\cdots,n\}, x+y+z>0\}.$ Find the smallest number of planes that jointly contain all $(n+1)^3-1$ points of $S$ but none of them passes through the origin. Provide the value of this expression when n = 2.

Let's think step by step and output the final answer within \boxed{}.
user