program main implicit none integer*8::N,i integer*8,allocatable::pat(:) read *,N allocate(pat(-1:N)) pat(-1) = 0 pat(0) = 1 do i=1,N pat(i) = pat(i-1) + pat(i-2) end do print '(i0)',pat(N) end program main