






import enum
import inspect
from typing import Iterable, List, Optional, Tuple, Union





class   SCREAMING_SNAKE_CASE (       enum.Enum    ):





							"""simple docstring"""

							A_       =    "timm"
							A_       =    "transformers"




def    __A    (   _lowercase    ,	_lowercase    ,	_lowercase       ):

					'''simple docstring'''







					if stage_names is None:
										raise ValueError('''Stage_names must be set for transformers backbones'''       )

					if out_features is not None:
										if not isinstance(_lowercase    ,	(list,)       ):
															raise ValueError(f"""out_features must be a list {type(_lowercase       )}"""       )
										if any(feat not in stage_names for feat in out_features       ):
															raise ValueError(f"""out_features must be a subset of stage_names: {stage_names} got {out_features}"""       )

					if out_indices is not None:
										if not isinstance(_lowercase    ,	(list, tuple)       ):
															raise ValueError(f"""out_indices must be a list or tuple, got {type(_lowercase       )}"""       )
										if any(idx >= len(_lowercase       ) for idx in out_indices       ):
															raise ValueError('''out_indices must be valid indices for stage_names {stage_names}, got {out_indices}'''       )

					if out_features is not None and out_indices is not None:
										if len(_lowercase       ) != len(_lowercase       ):
															raise ValueError('''out_features and out_indices should have the same length if both are set'''       )
										if out_features != [stage_names[idx] for idx in out_indices]:
															raise ValueError('''out_features and out_indices should correspond to the same stages if both are set'''       )




def    __A    (   _lowercase    ,	_lowercase    ,	_lowercase    ,	):

					'''simple docstring'''







					if out_indices is None and out_features is None:
										_A									=       [len(_lowercase       ) - 1]
										_A									=       [stage_names[-1]]
					elif out_indices is None and out_features is not None:
										_A									=       [stage_names.index(_lowercase       ) for layer in out_features]
					elif out_features is None and out_indices is not None:
										_A									=       [stage_names[idx] for idx in out_indices]
					return out_features, out_indices




def    __A    (   _lowercase    ,	_lowercase    ,	_lowercase    ,	):

					'''simple docstring'''







					verify_out_features_out_indices(out_features=_lowercase    ,	out_indices=_lowercase    ,	stage_names=_lowercase       )
					_A							,_A									=       _align_output_features_output_indices(
					    out_features=_lowercase    ,	out_indices=_lowercase    ,	stage_names=_lowercase       )
					# Verify that the aligned out_features and out_indices are valid
					verify_out_features_out_indices(out_features=_lowercase    ,	out_indices=_lowercase    ,	stage_names=_lowercase       )
					return output_features, output_indices





class   SCREAMING_SNAKE_CASE :





							"""simple docstring"""

							A_       =    None

							def 					__A       (     self:      Optional[int]						,   __A:      List[str]      )			-> None:
												if getattr(self						,   '''_backbone'''						,   __A      ) is None:
																	raise ValueError('''self._backbone must be set before calling _init_timm_backbone'''      )

												# These will diagree with the defaults for the transformers models e.g. for resnet50
												# the transformer model has out_features = ['stem', 'stage1', 'stage2', 'stage3', 'stage4']
												# the timm model has out_features = ['act', 'layer1', 'layer2', 'layer3', 'layer4']
												_A									=       [stage['''module'''] for stage in self._backbone.feature_info.info]
												_A									=       [stage['''num_chs'''] for stage in self._backbone.feature_info.info]
												_A									=       self._backbone.feature_info.out_indices
												_A									=       self._backbone.feature_info.module_name()

												# We verify the out indices and out features are valid
												verify_out_features_out_indices(
												    out_features=__A						,   out_indices=__A						,   stage_names=self.stage_names      )
												_A							,_A									=       out_features, out_indices

							def 					__A       (     self:      Optional[Any]						,   __A:      Optional[int]      )			-> None:
												_A									=       getattr(__A						,   '''stage_names'''      )
												_A									=       getattr(__A						,   '''out_features'''						,   __A      )
												_A									=       getattr(__A						,   '''out_indices'''						,   __A      )

												_A									=       stage_names
												_A							,_A									=       get_aligned_output_features_output_indices(
												    out_features=__A						,   out_indices=__A						,   stage_names=__A      )
												# Number of channels for each stage. This is set in the transformer backbone model init
												_A									=       None

							def 					__A       (     self:      List[str]						,   __A:      int      )			-> None:
												_A									=       config

												_A									=       getattr(__A						,   '''use_timm_backbone'''						,   __A      )
												_A									=       BackboneType.TIMM if self.use_timm_backbone else BackboneType.TRANSFORMERS

												if self.backbone_type == BackboneType.TIMM:
																	self._init_timm_backbone(__A      )
												elif self.backbone_type == BackboneType.TRANSFORMERS:
																	self._init_transformers_backbone(__A      )
												else:
																	raise ValueError(f"""backbone_type {self.backbone_type} not supported."""      )

							@property
							def 					__A       (     self:      Any      )			-> int:
												return self._out_features

							@out_features.setter
							def 					__A       (     self:      str						,   __A:      List[str]      )			-> Optional[Any]:
												_A							,_A									=       get_aligned_output_features_output_indices(
												    out_features=__A						,   out_indices=__A						,   stage_names=self.stage_names      )

							@property
							def 					__A       (     self:      int      )			-> List[Any]:
												return self._out_indices

							@out_indices.setter
							def 					__A       (     self:      List[str]						,   __A:      Union[Tuple[int], List[int]]      )			-> str:
												_A							,_A									=       get_aligned_output_features_output_indices(
												    out_features=__A						,   out_indices=__A						,   stage_names=self.stage_names      )

							@property
							def 					__A       (     self:      Tuple      )			-> Optional[Any]:
												# the current backbones will output the number of channels for each stage
												# even if that stage is not in the out_features list.
												return {stage: self.num_features[i] for i, stage in enumerate(self.stage_names      )}

							@property
							def 					__A       (     self:      List[str]      )			-> Union[str, Any]:
												return [self.out_feature_channels[name] for name in self.out_features]

							def 					__A       (     self:      List[Any]						,   *__A:      str						,   **__A:      int      )			-> List[str]:
												_A									=       dict(inspect.signature(self.forward      ).parameters      )
												_A									=       {k: v for k, v in kwargs.items() if k in signature}
												return self(*__A						,   **__A      )

							def 					__A       (     self:      str						,   __A:      Dict						,   __A:      Optional[bool] = None						,   __A:      Optional[bool] = None						,   __A:      Optional[bool] = None						,   )			-> Any:
												raise NotImplementedError('''This method should be implemented by the derived class.'''      )



							def 					__A       (     self:      Optional[Any]      )			-> int:
												_A									=       super().to_dict()
												_A									=       output.pop('''_out_features'''      )
												_A									=       output.pop('''_out_indices'''      )
												return output





class   SCREAMING_SNAKE_CASE :





							"""simple docstring"""

							@property
							def 					__A       (     self:      Tuple      )			-> Dict:
												return self._out_features

							@out_features.setter
							def 					__A       (     self:      Optional[int]						,   __A:      List[str]      )			-> Tuple:
												_A							,_A									=       get_aligned_output_features_output_indices(
												    out_features=__A						,   out_indices=__A						,   stage_names=self.stage_names      )

							@property
							def 					__A       (     self:      Optional[int]      )			-> List[str]:
												return self._out_indices

							@out_indices.setter
							def 					__A       (     self:      Optional[int]						,   __A:      Union[Tuple[int], List[int]]      )			-> Union[str, Any]:
												_A							,_A									=       get_aligned_output_features_output_indices(
												    out_features=__A						,   out_indices=__A						,   stage_names=self.stage_names      )



							def 					__A       (     self:      int      )			-> str:
												_A									=       super().to_dict()
												_A									=       output.pop('''_out_features'''      )
												_A									=       output.pop('''_out_indices'''      )
												return output











from math import factorial




def    __A    (   _lowercase    ,	_lowercase       ):

					'''simple docstring'''







					return factorial(_lowercase       ) / (factorial(_lowercase       ) * factorial(n - r       ))




def    __A    (   ):

					'''simple docstring'''







					_A									=       0

					for i in range(1    ,	1_01       ):
										for j in range(1    ,	i + 1       ):
															if combinations(_lowercase    ,	_lowercase       ) > 1e6:
																				total += 1
					return total


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



