diff --git a/conformity.py b/conformity.py new file mode 100644 index 0000000..9e95589 --- /dev/null +++ b/conformity.py @@ -0,0 +1,21 @@ +n = int(input()) + +combinations = {} +maxcombi = 0 +combinations[maxcombi] = 0 + +for _ in range(n): + combi = "".join(sorted(input().strip().split())) + if combi in combinations.keys(): + combinations[combi] += 1 + if combinations[maxcombi] < combinations[combi]: + maxcombi = combi + else: + combinations[combi] = 1 + +max_value = combinations[maxcombi] +most_popular = sum( + [max_value for key in combinations if combinations[key] == max_value] +) + +print(most_popular if most_popular > 0 else len(combinations.keys()) - 1)