import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> n = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      n.add(sc.nextInt());
    }
    int k = sc.nextInt();

    Collections.sort(n);
    for (int i = 0; i < k; i++)
      n.set(2, ((Integer) n.get(2) * 2));
    int ans = 0;
    for (Integer num : n)
      ans += num;
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> n = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      n.add(sc.nextInt());
    }
    int k = sc.nextInt();

    Collections.sort(n);
    for (int i = 0; i < k; i++)
      n.set(2, ((Integer) n.get(2) * 2));
    int ans = 0;
    for (Integer num : n)
      ans += num;
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> n = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      n.add(sc.nextInt());
    }
    int k = sc.nextInt();

    Collections.sort(n);
    for (int i = 0; i < k; i++)
      n.set(2, ((Integer) n.get(2) * 2));
    int ans = 0;
    for (Integer num : n)
      ans += num;
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> n = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      n.add(sc.nextInt());
    }
    int k = sc.nextInt();

    Collections.sort(n);
    for (int i = 0; i < k; i++)
      n.set(2, ((Integer) n.get(2) * 2));
    int ans = 0;
    for (Integer num : n)
      ans += num;
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> n = new ArrayList<>(); n new ArrayList<>() for (int i = 0; i < 3; i++) {
      n.add(sc.nextInt());
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      n.add(sc.nextInt());
    } {
      n.add(sc.nextInt());
    } n.add(sc.nextInt()) n.add n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc Collections.sort(n) Collections.sort Collections n for (int i = 0; i < k; i++)
      n.set(2, ((Integer) n.get(2) * 2)); int i = 0; int i = 0; i 0 i < k i k i++ i++ i n.set(2, ((Integer) n.get(2) * 2)); n.set(2, ((Integer) n.get(2) * 2)) n.set n 2 ((Integer) n.get(2) * 2) (Integer) n.get(2) n.get n 2 2 int ans = 0; ans 0 for (Integer num : n)
      ans += num; Integer num n ans += num; ans += num ans num System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> n = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      n.add(sc.nextInt());
    }
    int k = sc.nextInt();

    Collections.sort(n);
    for (int i = 0; i < k; i++)
      n.set(2, ((Integer) n.get(2) * 2));
    int ans = 0;
    for (Integer num : n)
      ans += num;
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> n = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      n.add(sc.nextInt());
    }
    int k = sc.nextInt();

    Collections.sort(n);
    for (int i = 0; i < k; i++)
      n.set(2, ((Integer) n.get(2) * 2));
    int ans = 0;
    for (Integer num : n)
      ans += num;
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> n = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      n.add(sc.nextInt());
    }
    int k = sc.nextInt();

    Collections.sort(n);
    for (int i = 0; i < k; i++)
      n.set(2, ((Integer) n.get(2) * 2));
    int ans = 0;
    for (Integer num : n)
      ans += num;
    System.out.println(ans);
  }
}