





'''simple docstring'''

from collections.abc import Callable






class        UpperCAmelCase     :
 def __init__(    self				:Tuple						,	lowercase_				:Callable | None = None							)->							None:
     # Stores actual heap items.
     A__    =      []
     # Stores indexes of each item for supporting updates and deletion.
     A__    =      {}
     # Stores current size of heap.
     A__    =      0
     # Stores function used to evaluate the score of an item on which basis ordering
     # will be done.
     A__    =      key or (lambda lowercase_							: x)
 def 					UpperCAmelCase_							(    self				:Tuple						,	lowercase_				:int							)->							int | None:
     return int((i - 1) / 2							) if i > 0 else None
 def 					UpperCAmelCase_							(    self				:List[str]						,	lowercase_				:int							)->							int | None:
     A__    =      int(2 * i + 1							)
     return left if 0 < left < self.size else None
 def 					UpperCAmelCase_							(    self				:Tuple						,	lowercase_				:int							)->							int | None:
     A__    =      int(2 * i + 2							)
     return right if 0 < right < self.size else None
 def 					UpperCAmelCase_							(    self				:int						,	lowercase_				:int						,	lowercase_				:int							)->							None:
     A__,     A__    =      (
         self.pos_map[self.arr[j][0]],
         self.pos_map[self.arr[i][0]],
     )
     # Then swap the items in the list.
     A__,     A__    =      self.arr[j], self.arr[i]
 def 					UpperCAmelCase_							(    self				:List[Any]						,	lowercase_				:int						,	lowercase_				:int							)->							bool:
     return self.arr[i][1] < self.arr[j][1]
 def 					UpperCAmelCase_							(    self				:List[str]						,	lowercase_				:int							)->							int:
     A__    =      self._left(lowercase_							)
     A__    =      self._right(lowercase_							)
     A__    =      i

     if left is not None and not self._cmp(lowercase_						,	lowercase_							):
         A__    =      left
     if right is not None and not self._cmp(lowercase_						,	lowercase_							):
         A__    =      right

     return valid_parent
 def 					UpperCAmelCase_							(    self				:Any						,	lowercase_				:int							)->							None:
     A__    =      self._parent(lowercase_							)
     while parent is not None and not self._cmp(lowercase_						,	lowercase_							):
         self._swap(lowercase_						,	lowercase_							)
         A__,     A__    =      parent, self._parent(lowercase_							)
 def 					UpperCAmelCase_							(    self				:Union[str, Any]						,	lowercase_				:int							)->							None:
     A__    =      self._get_valid_parent(lowercase_							)
     while valid_parent != index:
         self._swap(lowercase_						,	lowercase_							)
         A__,     A__    =      valid_parent, self._get_valid_parent(lowercase_							)
 def 					UpperCAmelCase_							(    self				:Optional[int]						,	lowercase_				:int						,	lowercase_				:int							)->							None:
     if item not in self.pos_map:
         return
     A__    =      self.pos_map[item]
     A__    =      [item, self.key(lowercase_							)]
     # Make sure heap is right in both up and down direction.
     # Ideally only one of them will make any change.
     self._heapify_up(lowercase_							)
     self._heapify_down(lowercase_							)
 def 					UpperCAmelCase_							(    self				:Union[str, Any]						,	lowercase_				:int							)->							None:
     if item not in self.pos_map:
         return
     A__    =      self.pos_map[item]
     del self.pos_map[item]
     A__    =      self.arr[self.size - 1]
     A__    =      index
     self.size -= 1
     # Make sure heap is right in both up and down direction. Ideally only one
     # of them will make any change- so no performance loss in calling both.
     if self.size > index:
         self._heapify_up(lowercase_							)
         self._heapify_down(lowercase_							)
 def 					UpperCAmelCase_							(    self				:Tuple						,	lowercase_				:int						,	lowercase_				:int							)->							None:
     A__    =      len(self.arr							)
     if arr_len == self.size:
         self.arr.append([item, self.key(lowercase_							)]							)
     else:
         A__    =      [item, self.key(lowercase_							)]
     A__    =      self.size
     self.size += 1
     self._heapify_up(self.size - 1							)
 def 					UpperCAmelCase_							(    self				:List[Any]							)->							tuple | None:
     return self.arr[0] if self.size else None



 def 					UpperCAmelCase_							(    self				:List[str]							)->							tuple | None:
     A__    =      self.get_top()
     if top_item_tuple:
         self.delete_item(top_item_tuple[0]							)
     return top_item_tuple





def 						UpperCamelCase    (							):
    pass


if __name__ == "__main__":
  import doctest

  doctest.testmod()










'''simple docstring'''

def 						UpperCamelCase    (							):
    A__    =      [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

    A__    =      6
    A__    =      1
    A__    =      19_01

    A__    =      0

    while year < 20_01:
        day += 7

        if (year % 4 == 0 and year % 1_00 != 0) or (year % 4_00 == 0):
            if day > days_per_month[month - 1] and month != 2:
                month += 1
                A__    =      day - days_per_month[month - 2]
            elif day > 29 and month == 2:
                month += 1
                A__    =      day - 29
        else:
            if day > days_per_month[month - 1]:
                month += 1
                A__    =      day - days_per_month[month - 2]

        if month > 12:
            year += 1
            A__    =      1

        if year < 20_01 and day == 1:
            sundays += 1
    return sundays


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



