
year =
    concat [[1..31],[1..28],[1..31],[1..30],[1..31],[1..30],
            [1..31],[1..31],[1..30],[1..31],[1..30],[1..31]]

leapYear =
    concat [[1..31],[1..29],[1..31],[1..30],[1..31],[1..30],
            [1..31],[1..31],[1..30],[1..31],[1..30],[1..31]]

dates =
    cycle $ concat [year, year, year, leapYear]

daysOfWeek =
    cycle ["Tu", "W", "Th", "F", "Sa", "Su", "M"]

solution =
    length $ filter ((1, "Su") ==) $ take daysInCentury $ zip dates daysOfWeek
    where daysInCentury = 25 * (366 + 365 + 365 + 365)
    
main = print solution

