Forward and backward counting by 1's