A simple way to do this is to have two extra variables, one to track the crossing from 0 to 1 and the other to track the crossing from 1 to 0. The thing you will need to take into consideration is that you only want to increment these values when Zero_Cross changes. As an example:
int oneToZero;
int zeroToOne;
int Zero_Cross;
if (BackFromPowerLoss > 20)
{
if (Zero_Cross == 1)
{
oneToZero++;
}
Zero_Cross = 0;
}
You should be able to fill the rest in from that snippet. The key thing is that you need to check what the previous value of Zero_Cross is before you change it.