ugly version of languages without duplicates and counting