Medals Count

This problem is now part of the collection Olympic Logic.