Counting Smoke Detector Wires In Junction Box
For box  fill calclations, you start with cubic inches...different wires take different amounts of space. 


18 AWG wires take 1.5 cubic inches
16 AWG wires take 1.75
14 AWG takes 2.00
12 AWG takes 2.25
10 AWG takes 2.50
8 AWG takes 3.00
6 AWG takes 5.00 cubic inches


Larger wires require special engineering. 

all grounds are broken out and count only as 1 of rhe largest ground wire.

All cable clamps together count as 1 of the largest wire clamped.

If there is a yoke (mounted piece of equipment in the box), that counts as 2  of the largest wire going to it. 

You have to total up the cubic inches and make sure the box is big