Here is a possible solution for you. Enter in E6 and fill down.
Formula: copy to clipboard
=IF(ISNUMBER(SEARCH("Customer",D6)),"",IF(AND(D6<>D5,D6="F"),1,E5+1))