what is the rule for input 36 output 9 input 17 output 9 input 24 output1 input 18 output 0