


'''simple docstring'''




def 				a_							(    lowercase     )      ->int:






				'''simple docstring'''

				if not isinstance(lowercase				,    lowercase     ) or not all(
				    isinstance(lowercase				,    lowercase     ) and item >= 0 for item in citations     ):
								raise ValueError("The citations should be a list of non negative integers."     )

				citations.sort()
				__lowerCamelCase		:   List[Any]           =       len(lowercase     )

				for i in range(lowercase     ):
								if citations[len_citations - 1 - i] <= i:
												return i

				return len_citations


if __name__ == "__main__":
				import doctest

				doctest.testmod()









'''simple docstring'''




import os





def 				a_							(    )      ->int:






				'''simple docstring'''

				__lowerCamelCase		:   Dict           =       os.path.dirname(os.path.realpath(lowercase     )     )
				__lowerCamelCase		:   Any           =       os.path.join(lowercase				,    "triangle.txt"     )

				with open(lowercase     ) as in_file:
								__lowerCamelCase		:   List[str]           =       [[int(lowercase     ) for i in line.split()] for line in in_file]

				while len(lowercase     ) != 1:
								__lowerCamelCase		:   List[str]           =       triangle.pop()
								__lowerCamelCase		:   Union[str, Any]           =       triangle[-1]
								for j in range(len(lowercase     ) - 1     ):
												curr_row[j] += max(last_row[j]				,    last_row[j + 1]     )
				return triangle[0][0]


if __name__ == "__main__":
				print(solution())





