Counting occurrences of a pattern in a binary word | Synapse