Quantity gate