1. Create little extension with helper class or add code to existed extension.
  2. Get options count, for example in catalog product list get product colors count.