import java.io.*;
import java.util.*;

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

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