Case 1: 1 Case 2: 7 Case 3: impossible