There was a typo in question.
Sequence ab appears 5 times in aebabdb not 4 times.
By taking option (A), we get the answer 5 which is correct answer for given examples
So, option (A) is correct.