python collections counter complexity