inventory size calculation