Python Distinct Count Formula