import java.util.Scanner;

public class Main {
  private static final Scanner scanner = new Scanner(System.in);

  public static void main(String[] args) {
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int k = scanner.nextInt();
    solve(a, b, c, k);
  }

  static void solve(int a, int b, int c, int k) {
    int a1 = a;
    int b1 = b;
    int c1 = c;
    int res = 0;
    for (int i = 0; i < k; i++) {
      a1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      b1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      c1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    System.out.println(res);
  }

} import java.util.Scanner; Scanner java.util public class Main {
  private static final Scanner scanner = new Scanner(System.in);

  public static void main(String[] args) {
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int k = scanner.nextInt();
    solve(a, b, c, k);
  }

  static void solve(int a, int b, int c, int k) {
    int a1 = a;
    int b1 = b;
    int c1 = c;
    int res = 0;
    for (int i = 0; i < k; i++) {
      a1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      b1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      c1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    System.out.println(res);
  }

} Main private static final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) public static void main(String[] args) {
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int k = scanner.nextInt();
    solve(a, b, c, k);
  } main {
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int k = scanner.nextInt();
    solve(a, b, c, k);
  } int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int c = scanner.nextInt(); c scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner solve(a, b, c, k) solve a b c k String[] args args static void solve(int a, int b, int c, int k) {
    int a1 = a;
    int b1 = b;
    int c1 = c;
    int res = 0;
    for (int i = 0; i < k; i++) {
      a1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      b1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      c1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    System.out.println(res);
  } solve {
    int a1 = a;
    int b1 = b;
    int c1 = c;
    int res = 0;
    for (int i = 0; i < k; i++) {
      a1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      b1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      c1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    System.out.println(res);
  } int a1 = a; a1 a int b1 = b; b1 b int c1 = c; c1 c int res = 0; res 0 for (int i = 0; i < k; i++) {
      a1 *= 2;
    } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
      a1 *= 2;
    } {
      a1 *= 2;
    } a1 *= 2 a1 2 res = Math.max(res, a1 + b1 + c1) res Math.max(res, a1 + b1 + c1) Math.max Math res a1 + b1 + c1 a1 + b1 + c1 a1 b1 c1 a1 = a a1 a b1 = b b1 b c1 = c c1 c for (int i = 0; i < k; i++) {
      b1 *= 2;
    } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
      b1 *= 2;
    } {
      b1 *= 2;
    } b1 *= 2 b1 2 res = Math.max(res, a1 + b1 + c1) res Math.max(res, a1 + b1 + c1) Math.max Math res a1 + b1 + c1 a1 + b1 + c1 a1 b1 c1 a1 = a a1 a b1 = b b1 b c1 = c c1 c for (int i = 0; i < k; i++) {
      c1 *= 2;
    } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
      c1 *= 2;
    } {
      c1 *= 2;
    } c1 *= 2 c1 2 res = Math.max(res, a1 + b1 + c1) res Math.max(res, a1 + b1 + c1) Math.max Math res a1 + b1 + c1 a1 + b1 + c1 a1 b1 c1 System.out.println(res) System.out.println System.out System System.out res int a a int b b int c c int k k public class Main {
  private static final Scanner scanner = new Scanner(System.in);

  public static void main(String[] args) {
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int k = scanner.nextInt();
    solve(a, b, c, k);
  }

  static void solve(int a, int b, int c, int k) {
    int a1 = a;
    int b1 = b;
    int c1 = c;
    int res = 0;
    for (int i = 0; i < k; i++) {
      a1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      b1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      c1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    System.out.println(res);
  }

} public class Main {
  private static final Scanner scanner = new Scanner(System.in);

  public static void main(String[] args) {
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int k = scanner.nextInt();
    solve(a, b, c, k);
  }

  static void solve(int a, int b, int c, int k) {
    int a1 = a;
    int b1 = b;
    int c1 = c;
    int res = 0;
    for (int i = 0; i < k; i++) {
      a1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      b1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      c1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    System.out.println(res);
  }

} Main
import java.util.Scanner;

public class Main {
  private static final Scanner scanner = new Scanner(System.in);

  public static void main(String[] args) {
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int k = scanner.nextInt();
    solve(a, b, c, k);
  }

  static void solve(int a, int b, int c, int k) {
    int a1 = a;
    int b1 = b;
    int c1 = c;
    int res = 0;
    for (int i = 0; i < k; i++) {
      a1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      b1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    a1 = a;
    b1 = b;
    c1 = c;
    for (int i = 0; i < k; i++) {
      c1 *= 2;
    }
    res = Math.max(res, a1 + b1 + c1);
    System.out.println(res);
  }

}