program main
  implicit none
  
  integer :: a(3),i,n,big,t,j
  read(*,*)a(1),a(2),a(3)
  read(*,*)n
  
  do i=1,2
     do j=i+1,3
        if(a(i) .gt. a(j))then
           t=a(i)
           a(i)=a(j)
           a(j)=t
        end if
     end do
  end do
  
  do i = 1, n
    a(3) = a(3)*2
  end do
  
  write(*,*)sum(a)
end program main
  