Check that if-statement was true several times at a stretch : I have a loop

    count = 0;
    do
    {
        ...
        if (statement)
            count++;
        ...
    } while (count != 3);
How to check that if statement was true three times at a stretch?