All three must have been dead-ball. When UNS and/or UNR fouls by both teams occur after the ball is dead and before the penalty for any of them is "completed," then they all offset, and the penalties cancel. Assuming this to be the case, the previous play would 'count,' so the next down would be the next in the series.
What was the next down?
If any of the fouls were live-ball, then I can't explain the total offset.