I need a way to calculate the total number of red cells that follow the previous red cells ONLY diagonally. The cells that needs to be calculated
are colored in red.

(if it helps, you can assume reds as 1, and grays 0, but in the example below I colored 1s in white just to show which ones are counted).

Here is a picture of sample data:

data.png

Here is some possible scenarios to clarify it.

possible scenarios.png

I hope I explained it, please ask if it isn't clear.
I tried to find a solution with nested ifs but couldn't figure it out. Can someone help please? thanks.