Well done !
First you make out of nine used cigarettes three cigarettes and smoke them.
You have now 1 (10-9) + 3 (the 3 you just smoked) = 4 used cigarettes.
Then you make one out of three used cigarettes.
You have now 1 (4-3) + 1 (the one you just smoked) = 2 used cigarettes.
Then you lend a used cigarette from an other guy in prison and make a fifth cigarette.
You smoke it and give the guy the used cigarette back.
You have now smoked 5 cigarettes !