input: Write a python function that inverts all bits of a given number except for the first and last bit.
  assert toggle_inner_bits(9) == 15
  assert toggle_inner_bits(10) == 12
  assert toggle_inner_bits(11) == 13
output: def toggle_inner_bits(n):
      if n < 3:
          return n
      length = n.bit_length()
      mask = ((1 << (length - 2)) - 1) << 1
      return n ^ mask