plant quantity calculation