


from collections.abc import Iterator, MutableMapping
from dataclasses import dataclass
from typing import Generic, TypeVar

__UpperCamelCase    :						str     =							TypeVar('KEY')
__UpperCamelCase    :						Optional[Any]     =							TypeVar('VAL')



@dataclass(frozen=A,slots=A						)
class 							_UpperCamelCase (						Generic[KEY, VAL]						):

   '''simple docstring'''







   a_				:							KEY
   a_				:							VAL



class 							_UpperCamelCase (						_Item						):

   '''simple docstring'''







   def __init__(  self  : Any							):






         '''simple docstring'''



         super().__init__(_lowerCamelCase       ,  _lowerCamelCase							)


   def __bool__(  self  : int							):






         '''simple docstring'''



         return False

__UpperCamelCase    :						List[str]     =							_DeletedItem()



class 							_UpperCamelCase (						MutableMapping[KEY, VAL]						):

   '''simple docstring'''







   def __init__(  self  : Any       ,  _lowerCamelCase  : int = 8       ,  _lowerCamelCase  : float = 0.75							):






         '''simple docstring'''



         __lowerCamelCase     :      Optional[int]       						=						initial_block_size
         __lowerCamelCase     :      list[_Item | None]       						=						[None] * initial_block_size
         assert 0.0 < capacity_factor < 1.0
         __lowerCamelCase     :      Any       						=						capacity_factor
         __lowerCamelCase     :      Any       						=						0

   def   _snake_case    (  self  : Any       ,  _lowerCamelCase  : KEY							):






         '''simple docstring'''



         return hash(_lowerCamelCase							) % len(self._buckets							)

   def   _snake_case    (  self  : int       ,  _lowerCamelCase  : int							):






         '''simple docstring'''



         return (ind + 1) % len(self._buckets							)

   def   _snake_case    (  self  : Tuple       ,  _lowerCamelCase  : int       ,  _lowerCamelCase  : KEY       ,  _lowerCamelCase  : VAL							):






         '''simple docstring'''



         __lowerCamelCase     :      str       						=						self._buckets[ind]
         if not stored:
               __lowerCamelCase     :      int       						=						_Item(_lowerCamelCase       ,  _lowerCamelCase							)
               self._len += 1
               return True
         elif stored.key == key:
               __lowerCamelCase     :      Optional[int]       						=						_Item(_lowerCamelCase       ,  _lowerCamelCase							)
               return True
         else:
               return False

   def   _snake_case    (  self  : str							):






         '''simple docstring'''



         __lowerCamelCase     :      Union[str, Any]       						=						len(self._buckets							) * self._capacity_factor
         return len(self							) >= int(_lowerCamelCase							)

   def   _snake_case    (  self  : Union[str, Any]							):






         '''simple docstring'''



         if len(self._buckets							) <= self._initial_block_size:
               return False
         __lowerCamelCase     :      Optional[Any]       						=						len(self._buckets							) * self._capacity_factor / 2
         return len(self							) < limit

   def   _snake_case    (  self  : List[str]       ,  _lowerCamelCase  : int							):






         '''simple docstring'''



         __lowerCamelCase     :      Dict       						=						self._buckets
         __lowerCamelCase     :      Tuple       						=						[None] * new_size
         __lowerCamelCase     :      Optional[Any]       						=						0
         for item in old_buckets:
               if item:
                     self._add_item(item.key       ,  item.val							)

   def   _snake_case    (  self  : Tuple							):






         '''simple docstring'''



         self._resize(len(self._buckets							) * 2							)

   def   _snake_case    (  self  : int							):






         '''simple docstring'''



         self._resize(len(self._buckets							) // 2							)

   def   _snake_case    (  self  : Any       ,  _lowerCamelCase  : KEY							):






         '''simple docstring'''



         __lowerCamelCase     :      List[Any]       						=						self._get_bucket_index(_lowerCamelCase							)
         for _ in range(len(self._buckets							)							):
               yield ind
               __lowerCamelCase     :      List[Any]       						=						self._get_next_ind(_lowerCamelCase							)

   def   _snake_case    (  self  : str       ,  _lowerCamelCase  : KEY       ,  _lowerCamelCase  : VAL							):






         '''simple docstring'''



         for ind in self._iterate_buckets(_lowerCamelCase							):
               if self._try_set(_lowerCamelCase       ,  _lowerCamelCase       ,  _lowerCamelCase							):
                     break

   def __setitem__(  self  : Any       ,  _lowerCamelCase  : KEY       ,  _lowerCamelCase  : VAL							):






         '''simple docstring'''



         if self._is_full():
               self._size_up()

         self._add_item(_lowerCamelCase       ,  _lowerCamelCase							)

   def __delitem__(  self  : List[Any]       ,  _lowerCamelCase  : KEY							):






         '''simple docstring'''



         for ind in self._iterate_buckets(_lowerCamelCase							):
               __lowerCamelCase     :      Optional[int]       						=						self._buckets[ind]
               if item is None:
                     raise KeyError(_lowerCamelCase							)
               if item is _deleted:
                     continue
               if item.key == key:
                     __lowerCamelCase     :      Dict       						=						_deleted
                     self._len -= 1
                     break
         if self._is_sparse():
               self._size_down()

   def __getitem__(  self  : Any       ,  _lowerCamelCase  : KEY							):






         '''simple docstring'''



         for ind in self._iterate_buckets(_lowerCamelCase							):
               __lowerCamelCase     :      Optional[int]       						=						self._buckets[ind]
               if item is None:
                     break
               if item is _deleted:
                     continue
               if item.key == key:
                     return item.val
         raise KeyError(_lowerCamelCase							)

   def __len__(  self  : Union[str, Any]							):






         '''simple docstring'''



         return self._len

   def __iter__(  self  : Tuple							):






         '''simple docstring'''



         yield from (item.key for item in self._buckets if item)


   def __repr__(  self  : int							):






         '''simple docstring'''



         __lowerCamelCase     :      str       						=						""" ,""".join(
             F"""{item.key}: {item.val}""" for item in self._buckets if item							)
         return F"""HashMap({val_string})"""







def   _UpperCAmelCase       (     UpperCAmelCase      :			int = 4_000_000      ):
      """simple docstring"""




      __lowerCamelCase     :      Union[str, Any]       						=						[0, 1]
      __lowerCamelCase     :      Dict       						=						0
      while fib[i] <= n:
            fib.append(fib[i] + fib[i + 1]      )
            if fib[i + 2] > n:
                  break
            i += 1
      __lowerCamelCase     :      Any       						=						0
      for j in range(len(UpperCAmelCase      ) - 1      ):
            if fib[j] % 2 == 0:
                  total += fib[j]

      return total


if __name__ == "__main__":
    print(F'''{solution() = }''')



