import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x[] = new int[3];
    x[0]=sc.nextInt();
    x[1]=sc.nextInt();
    x[2]=sc.nextInt();
    int n = sc.nextInt();
    Arrays.sort(x);
    System.out.println((int)(x[0]+x[1]+x[2]*Math.pow(2,n)));
  }
  

  
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x[] = new int[3];
    x[0]=sc.nextInt();
    x[1]=sc.nextInt();
    x[2]=sc.nextInt();
    int n = sc.nextInt();
    Arrays.sort(x);
    System.out.println((int)(x[0]+x[1]+x[2]*Math.pow(2,n)));
  }
  

  
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x[] = new int[3];
    x[0]=sc.nextInt();
    x[1]=sc.nextInt();
    x[2]=sc.nextInt();
    int n = sc.nextInt();
    Arrays.sort(x);
    System.out.println((int)(x[0]+x[1]+x[2]*Math.pow(2,n)));
  } main {
    Scanner sc = new Scanner(System.in);
    int x[] = new int[3];
    x[0]=sc.nextInt();
    x[1]=sc.nextInt();
    x[2]=sc.nextInt();
    int n = sc.nextInt();
    Arrays.sort(x);
    System.out.println((int)(x[0]+x[1]+x[2]*Math.pow(2,n)));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x[] = new int[3]; x new int[3] 3 x[0]=sc.nextInt() x[0] x 0 sc.nextInt() sc.nextInt sc x[1]=sc.nextInt() x[1] x 1 sc.nextInt() sc.nextInt sc x[2]=sc.nextInt() x[2] x 2 sc.nextInt() sc.nextInt sc int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Arrays.sort(x) Arrays.sort Arrays x System.out.println((int)(x[0]+x[1]+x[2]*Math.pow(2,n))) System.out.println System.out System System.out (int)(x[0]+x[1]+x[2]*Math.pow(2,n)) x[0]+x[1]+x[2]*Math.pow(2,n) x[0] x 0 x[1] x 1 x[2]*Math.pow(2,n) x[2] x 2 Math.pow(2,n) Math.pow Math 2 n String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x[] = new int[3];
    x[0]=sc.nextInt();
    x[1]=sc.nextInt();
    x[2]=sc.nextInt();
    int n = sc.nextInt();
    Arrays.sort(x);
    System.out.println((int)(x[0]+x[1]+x[2]*Math.pow(2,n)));
  }
  

  
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x[] = new int[3];
    x[0]=sc.nextInt();
    x[1]=sc.nextInt();
    x[2]=sc.nextInt();
    int n = sc.nextInt();
    Arrays.sort(x);
    System.out.println((int)(x[0]+x[1]+x[2]*Math.pow(2,n)));
  }
  

  
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x[] = new int[3];
    x[0]=sc.nextInt();
    x[1]=sc.nextInt();
    x[2]=sc.nextInt();
    int n = sc.nextInt();
    Arrays.sort(x);
    System.out.println((int)(x[0]+x[1]+x[2]*Math.pow(2,n)));
  }
  

  
}
