



"""simple docstring"""







from collections import Counter


def  __SCREAMING_SNAKE_CASE (  __UpperCAmelCase      ):
		return sum(socks_by_color // 2 for socks_by_color in Counter(__UpperCAmelCase      ).values()      )


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		UpperCAmelCase:  Union[str, Any]			     =				[int(x) for x in input("""Enter socks by color :""").rstrip().split()]
		print(F'sock_merchant({colors}) = {sock_merchant(colors)}')








import argparse
import json
import re
import string
import sys
from collections import Counter


def 						_UpperCAmelCase							( snake_case     ):





					"""simple docstring"""

					def remove_articles(snake_case     ):
										return re.sub(R"""\b(a|an|the)\b"""      ,		""" """      ,		snake_case     )

					def white_space_fix(snake_case     ):
										return " ".join(text.split()     )

					def remove_punc(snake_case     ):
										_lowerCAmelCase         =       set(string.punctuation     )
										return "".join(ch for ch in text if ch not in exclude     )

					def lower(snake_case     ):
										return text.lower()

					return white_space_fix(remove_articles(remove_punc(lower(snake_case     )     )     )     )


def 						_UpperCAmelCase							( snake_case      ,		snake_case     ):





					"""simple docstring"""

					_lowerCAmelCase         =       normalize_answer(snake_case     ).split()
					_lowerCAmelCase         =       normalize_answer(snake_case     ).split()
					_lowerCAmelCase         =       Counter(snake_case     ) & Counter(snake_case     )
					_lowerCAmelCase         =       sum(common.values()     )
					if num_same == 0:
										return 0
					_lowerCAmelCase         =       1.0 * num_same / len(snake_case     )
					_lowerCAmelCase         =       1.0 * num_same / len(snake_case     )
					_lowerCAmelCase         =       (2 * precision * recall) / (precision + recall)
					return fa


def 						_UpperCAmelCase							( snake_case      ,		snake_case     ):





					"""simple docstring"""

					return normalize_answer(snake_case     ) == normalize_answer(snake_case     )


def 						_UpperCAmelCase							( snake_case      ,		snake_case      ,		snake_case     ):





					"""simple docstring"""

					_lowerCAmelCase         =       []
					for ground_truth in ground_truths:
										_lowerCAmelCase         =       metric_fn(snake_case      ,		snake_case     )
										scores_for_ground_truths.append(snake_case     )
					return max(snake_case     )


def 						_UpperCAmelCase							( snake_case      ,		snake_case     ):





					"""simple docstring"""

					_lowerCAmelCase         =       _lowerCAmelCase         =       _lowerCAmelCase         =       0
					for article in dataset:
										for paragraph in article["paragraphs"]:
															for qa in paragraph["qas"]:
																				total += 1
																				if qa["id"] not in predictions:
																									_lowerCAmelCase         =       """Unanswered question """ + qa["""id"""] + """ will receive score 0."""
																									print(snake_case      ,		file=sys.stderr     )
																									continue
																				_lowerCAmelCase         =       [x["""text"""] for x in qa["""answers"""]]
																				_lowerCAmelCase         =       predictions[qa["""id"""]]
																				exact_match += metric_max_over_ground_truths(snake_case      ,		snake_case      ,		snake_case     )
																				fa += metric_max_over_ground_truths(snake_case      ,		snake_case      ,		snake_case     )

					_lowerCAmelCase         =       100.0 * exact_match / total
					_lowerCAmelCase         =       100.0 * fa / total

					return {"exact_match": exact_match, "f1": fa}


if __name__ == "__main__":
	A__       =			"""1.1"""
	A__       =			argparse.ArgumentParser(description="""Evaluation for SQuAD """ + expected_version)
	parser.add_argument("""dataset_file""", help="""Dataset file""")
	parser.add_argument("""prediction_file""", help="""Prediction File""")
	A__       =			parser.parse_args()
	with open(args.dataset_file) as dataset_file:
		A__       =			json.load(dataset_file)
		if dataset_json["version"] != expected_version:
			print(
			    """Evaluation expects v-""" + expected_version + """, but got dataset with v-""" + dataset_json["""version"""],
			    file=sys.stderr,
			)
		A__       =			dataset_json["""data"""]
	with open(args.prediction_file) as prediction_file:
		A__       =			json.load(prediction_file)
	print(json.dumps(evaluate(dataset, predictions)))



