Given a grid of 0s and 1s where 1 marks a blocked cell, count the number of distinct paths from the top-left cell to the bottom-right cell moving only right or down, never entering a blocked cell. Return 0 if the start or end is blocked.