Case 1: 2 1 Case 2: 0 2 Case 3: impossible Case 4: 0 7