Code to count and remove pairs containing duplicate sentences