from calendar import Calendar

class MyCalendar(Calendar):

    def count_weekday_in_year(self, year, weekday):

        count = 0

        for month in range(1, 13):

            month_calendar = self.monthdays2calendar(year, month)

            for week in month_calendar:

                for day_number, day_weekday in week:

                    if day_number != 0 and day_weekday == weekday:
                        count += 1

        return count


my_calendar = MyCalendar()


result = my_calendar.count_weekday_in_year(2000, 6)


print(result)
