In a certain examination paper, there are n questions. For $j=1, 2, \dots,n,$ there are $2^{n-i}$ students who answered $j$ or more questions wrongly. If the total number of wrong answer is $4095,$ then the value of $n$ is