





"""simple docstring"""






def      lowercase__ (					lowerCAmelCase__   :			int			)    ->			int:



			'''simple docstring'''
			if not isinstance(lowerCAmelCase__							,			lowerCAmelCase__			) or number < 0:
						raise ValueError("Input must be a non-negative integer"			)

			a__  :	Optional[Any]		 =			0
			while number:
						# This way we arrive at next set bit (next 1) instead of looping
						# through each bit and checking for 1s hence the
						# loop won't run 32 times it will only run the number of `1` times
						number &= number - 1
						count += 1
			return count


if __name__ == "__main__":
		import doctest

		doctest.testmod()






"""simple docstring"""






def      lowercase__ (					lowerCAmelCase__   :			str			)    ->			list[int]:



			'''simple docstring'''
			a__  :	List[str]		 =			[0 for i in range(len(lowerCAmelCase__			)			)]

			# initialize interval's left pointer and right pointer
			a__ ,	a__  :	int		 =			0, 0

			for i in range(1							,			len(lowerCAmelCase__			)			):
						# case when current index is inside the interval
						if i <= right_pointer:
									a__  :	List[Any]		 =			min(right_pointer - i + 1							,			z_result[i - left_pointer]			)
									a__  :	List[str]		 =			min_edge

						while go_next(lowerCAmelCase__							,			lowerCAmelCase__							,			lowerCAmelCase__			):
									z_result[i] += 1

						# if new index's result gives us more right interval,
						# we've to update left_pointer and right_pointer
						if i + z_result[i] - 1 > right_pointer:
									a__ ,	a__  :	str		 =			i, i + z_result[i] - 1

			return z_result






def      lowercase__ (					lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			list[int]							,			lowerCAmelCase__   :			str			)    ->			bool:



			'''simple docstring'''
			return i + z_result[i] < len(lowerCAmelCase__			) and s[z_result[i]] == s[i + z_result[i]]






def      lowercase__ (					lowerCAmelCase__   :			str							,			lowerCAmelCase__   :			str			)    ->			int:



			'''simple docstring'''
			a__  :	List[Any]		 =			0
			# concatenate 'pattern' and 'input_str' and call z_function
			# with concatenated string
			a__  :	List[str]		 =			z_function(pattern + input_str			)

			for val in z_result:
						# if value is greater then length of the pattern string
						# that means this index is starting position of substring
						# which is equal to pattern string
						if val >= len(lowerCAmelCase__			):
									answer += 1

			return answer


if __name__ == "__main__":
		import doctest

		doctest.testmod()