program main
  implicit none
  
  integer :: l0=2,l1=1,l2=3,i,n
  
  read(*,*)n
  if (n == 1) then
    write(*,*)1
  else if (n == 2) then
    write(*,*)3
  end if
  
  do i = 3, n
  	l0 = l1
    l1 = l2
    l2 = l0 + l1
  end do
  
  write(*,*)l2
end program main