get number of packages from the database