Case Number 1: 5 Case Number 2: 0 Case Number 3: impossible