print count of duplicates and define main