Calculating medicine needed to fill capsule