Step 1: Recall two standard limits.
\[\lim_{x\to 0}\frac{\cos x - 1}{x^2} = -\frac{1}{2}, \qquad \lim_{x\to 0}\frac{e^x-1}{x}=1\]
Step 2: Rewrite the second factor using these.
\[\cos x - e^x = (\cos x - 1) - (e^x-1)\]
so
\[\lim_{x\to 0}\frac{\cos x - e^x}{x} = \lim_{x\to 0}\frac{\cos x-1}{x} - \lim_{x\to 0}\frac{e^x-1}{x} = 0 - 1 = -1\]
Step 3: Combine the two pieces.
\[\lim_{x\to 0}\frac{(\cos x-1)(\cos x - e^x)}{x^3} = \lim_{x\to 0}\frac{\cos x-1}{x^2}\cdot\lim_{x\to 0}\frac{\cos x-e^x}{x} = \left(-\frac{1}{2}\right)(-1) = \frac{1}{2}\]
Step 4: Conclusion.
Since this limit with \(n=3\) comes out finite and non-zero (any smaller n blows up to infinity, any larger n gives zero), the required value is
\[\boxed{n=3}\]