Count Cells in Overlapping Horizontal and Vertical Substrings