PROGRAM numberofdays
  IMPLICIT NONE
  INTEGER :: month, year, days

  PRINT *, "Dwse mhna kai etos"
  READ *, month, year

  SELECT CASE (month)
  CASE(1,3,5,7,8,10,12)
     days = 31
  CASE (4,6,9,11)
     days = 30
  CASE (2)
     days = 28

     SELECT CASE (year)
     CASE (1923)
        days = 15
     CASE (1924:)
        IF ( (MOD(year,4) == 0) .AND. (MOD(year, 100) /= 0) &
             .OR. (MOD(year,400)==0) ) days = 29
     CASE (:1922)
        IF (MOD(year,4) == 0) days = 29
     END SELECT
  END SELECT

  PRINT *, "O mhnas poy edwses exei ", days, " hmeres"
END PROGRAM numberofdays
