import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();
    int max = a;
    if (max < b) {
      max = b;
    }
    if (max < c) {
      max = c;
    }
    System.out.println(a + b + c + max * ((1 << k) - 1));
  }

} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();
    int max = a;
    if (max < b) {
      max = b;
    }
    if (max < c) {
      max = c;
    }
    System.out.println(a + b + c + max * ((1 << k) - 1));
  }

} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();
    int max = a;
    if (max < b) {
      max = b;
    }
    if (max < c) {
      max = c;
    }
    System.out.println(a + b + c + max * ((1 << k) - 1));
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();
    int max = a;
    if (max < b) {
      max = b;
    }
    if (max < c) {
      max = c;
    }
    System.out.println(a + b + c + max * ((1 << k) - 1));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int max = a; max a if (max < b) {
      max = b;
    } max < b max b {
      max = b;
    } max = b max b if (max < c) {
      max = c;
    } max < c max c {
      max = c;
    } max = c max c System.out.println(a + b + c + max * ((1 << k) - 1)) System.out.println System.out System System.out a + b + c + max * ((1 << k) - 1) c a + b + c + max * ((1 << k) - 1) a b c max * ((1 << k) - 1) max ((1 << k) - 1) (1 << k) 1 k 1 String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();
    int max = a;
    if (max < b) {
      max = b;
    }
    if (max < c) {
      max = c;
    }
    System.out.println(a + b + c + max * ((1 << k) - 1));
  }

} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();
    int max = a;
    if (max < b) {
      max = b;
    }
    if (max < c) {
      max = c;
    }
    System.out.println(a + b + c + max * ((1 << k) - 1));
  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();
    int max = a;
    if (max < b) {
      max = b;
    }
    if (max < c) {
      max = c;
    }
    System.out.println(a + b + c + max * ((1 << k) - 1));
  }

}
