Count how many bray's are around, store in b.
0<=b<5
(b>>1)&&!(b&1) is short for (b==2)||(b==4)
try making a truth table and see yerself