import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    int a = stdIn.nextInt();
    int b = stdIn.nextInt();
    int c = stdIn.nextInt();
    int k = stdIn.nextInt();

    int max = a;
    if (max < b) max = b;
    if (max < c) max = c;

    int other = 0;
    if (max == a) other = b + c;
    if (max == b) other = c + a;
    if (max == c) other = a + b;

    for (int i = 0; i < k; i++) {
      max*=2;
    }

    System.out.println(max + other);
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    int a = stdIn.nextInt();
    int b = stdIn.nextInt();
    int c = stdIn.nextInt();
    int k = stdIn.nextInt();

    int max = a;
    if (max < b) max = b;
    if (max < c) max = c;

    int other = 0;
    if (max == a) other = b + c;
    if (max == b) other = c + a;
    if (max == c) other = a + b;

    for (int i = 0; i < k; i++) {
      max*=2;
    }

    System.out.println(max + other);
  }
} Main public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    int a = stdIn.nextInt();
    int b = stdIn.nextInt();
    int c = stdIn.nextInt();
    int k = stdIn.nextInt();

    int max = a;
    if (max < b) max = b;
    if (max < c) max = c;

    int other = 0;
    if (max == a) other = b + c;
    if (max == b) other = c + a;
    if (max == c) other = a + b;

    for (int i = 0; i < k; i++) {
      max*=2;
    }

    System.out.println(max + other);
  } main {
    Scanner stdIn = new Scanner(System.in);

    int a = stdIn.nextInt();
    int b = stdIn.nextInt();
    int c = stdIn.nextInt();
    int k = stdIn.nextInt();

    int max = a;
    if (max < b) max = b;
    if (max < c) max = c;

    int other = 0;
    if (max == a) other = b + c;
    if (max == b) other = c + a;
    if (max == c) other = a + b;

    for (int i = 0; i < k; i++) {
      max*=2;
    }

    System.out.println(max + other);
  } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int a = stdIn.nextInt(); a stdIn.nextInt() stdIn.nextInt stdIn int b = stdIn.nextInt(); b stdIn.nextInt() stdIn.nextInt stdIn int c = stdIn.nextInt(); c stdIn.nextInt() stdIn.nextInt stdIn int k = stdIn.nextInt(); k stdIn.nextInt() stdIn.nextInt stdIn int max = a; max a if (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 int other = 0; other 0 if (max == a) other = b + c; max == a max a other = b + c other b + c b c if (max == b) other = c + a; max == b max b other = c + a other c + a c a if (max == c) other = a + b; max == c max c other = a + b other a + b a b for (int i = 0; i < k; i++) {
      max*=2;
    } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
      max*=2;
    } {
      max*=2;
    } max*=2 max 2 System.out.println(max + other) System.out.println System.out System System.out max + other max other String[] args args
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    int a = stdIn.nextInt();
    int b = stdIn.nextInt();
    int c = stdIn.nextInt();
    int k = stdIn.nextInt();

    int max = a;
    if (max < b) max = b;
    if (max < c) max = c;

    int other = 0;
    if (max == a) other = b + c;
    if (max == b) other = c + a;
    if (max == c) other = a + b;

    for (int i = 0; i < k; i++) {
      max*=2;
    }

    System.out.println(max + other);
  }
}