Multiply length X width X height (in inches) and divide by 231.

This should get you close.

Bug