Case #1: 18 Case #2: 0 Case #3: 4 Case #4: 10 Case #5: 324 Case #6: 363067831