import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] number = new int[3];
    int sum = 0;
    
    for(int i=0;i<3;i++){
      number[i] = sc.nextInt();
      sum += number[i];
    }
    int K = sc.nextInt();
    int max = number[0];
    
    for(int j=0;j<2;j++){
      if(number[j+1]>number[j]){
        max = number[j+1];
      }
    }
    int answer = (int)(sum-max+max*Math.pow(2,K));
    System.out.println(answer);
  }
}
     import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] number = new int[3];
    int sum = 0;
    
    for(int i=0;i<3;i++){
      number[i] = sc.nextInt();
      sum += number[i];
    }
    int K = sc.nextInt();
    int max = number[0];
    
    for(int j=0;j<2;j++){
      if(number[j+1]>number[j]){
        max = number[j+1];
      }
    }
    int answer = (int)(sum-max+max*Math.pow(2,K));
    System.out.println(answer);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] number = new int[3];
    int sum = 0;
    
    for(int i=0;i<3;i++){
      number[i] = sc.nextInt();
      sum += number[i];
    }
    int K = sc.nextInt();
    int max = number[0];
    
    for(int j=0;j<2;j++){
      if(number[j+1]>number[j]){
        max = number[j+1];
      }
    }
    int answer = (int)(sum-max+max*Math.pow(2,K));
    System.out.println(answer);
  } main {
    Scanner sc = new Scanner(System.in);
    int[] number = new int[3];
    int sum = 0;
    
    for(int i=0;i<3;i++){
      number[i] = sc.nextInt();
      sum += number[i];
    }
    int K = sc.nextInt();
    int max = number[0];
    
    for(int j=0;j<2;j++){
      if(number[j+1]>number[j]){
        max = number[j+1];
      }
    }
    int answer = (int)(sum-max+max*Math.pow(2,K));
    System.out.println(answer);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] number = new int[3]; number new int[3] 3 int sum = 0; sum 0 for(int i=0;i<3;i++){
      number[i] = sc.nextInt();
      sum += number[i];
    } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
      number[i] = sc.nextInt();
      sum += number[i];
    } {
      number[i] = sc.nextInt();
      sum += number[i];
    } number[i] = sc.nextInt() number[i] number i sc.nextInt() sc.nextInt sc sum += number[i] sum number[i] number i int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int max = number[0]; max number[0] number 0 for(int j=0;j<2;j++){
      if(number[j+1]>number[j]){
        max = number[j+1];
      }
    } int j=0; int j=0; j 0 j<2 j 2 j++ j++ j {
      if(number[j+1]>number[j]){
        max = number[j+1];
      }
    } {
      if(number[j+1]>number[j]){
        max = number[j+1];
      }
    } if(number[j+1]>number[j]){
        max = number[j+1];
      } number[j+1]>number[j] number[j+1] number j+1 j 1 number[j] number j {
        max = number[j+1];
      } max = number[j+1] max number[j+1] number j+1 j 1 int answer = (int)(sum-max+max*Math.pow(2,K)); answer (int)(sum-max+max*Math.pow(2,K)) sum-max sum max max*Math.pow(2,K) max Math.pow(2,K) Math.pow Math 2 K System.out.println(answer) System.out.println System.out System System.out answer String[] args args
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] number = new int[3];
    int sum = 0;
    
    for(int i=0;i<3;i++){
      number[i] = sc.nextInt();
      sum += number[i];
    }
    int K = sc.nextInt();
    int max = number[0];
    
    for(int j=0;j<2;j++){
      if(number[j+1]>number[j]){
        max = number[j+1];
      }
    }
    int answer = (int)(sum-max+max*Math.pow(2,K));
    System.out.println(answer);
  }
}
    