import datetime
start = datetime.date(1949,10,1)
end = datetime.date(2012,10,1)
total = 0
while start <= end:
if start.weekday() == 6 and start.month ==10 and start.day == 1:
total += 1
start += datetime.timedelta(days=1)
print(total)