import java.util.*;
 
class Main{
	public static void main(String args[]) throws Exception{
		Scanner sc = new Scanner(System.in);
    int a= sc.nextInt();
    int b= sc.nextInt();
    int c= sc.nextInt();
    int d= sc.nextInt();

    int max = a;
    int otherSum = b+c;

    if(max < b){
      max = b;
      otherSum = a+c;
    }

    if(max < c){
      max = c;
      otherSum = a+b;
    }

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

    int sum = max + otherSum;
    System.out.println(sum);
	}
} import java.util.*; util.* java class Main{
	public static void main(String args[]) throws Exception{
		Scanner sc = new Scanner(System.in);
    int a= sc.nextInt();
    int b= sc.nextInt();
    int c= sc.nextInt();
    int d= sc.nextInt();

    int max = a;
    int otherSum = b+c;

    if(max < b){
      max = b;
      otherSum = a+c;
    }

    if(max < c){
      max = c;
      otherSum = a+b;
    }

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

    int sum = max + otherSum;
    System.out.println(sum);
	}
} Main public static void main(String args[]) throws Exception{
		Scanner sc = new Scanner(System.in);
    int a= sc.nextInt();
    int b= sc.nextInt();
    int c= sc.nextInt();
    int d= sc.nextInt();

    int max = a;
    int otherSum = b+c;

    if(max < b){
      max = b;
      otherSum = a+c;
    }

    if(max < c){
      max = c;
      otherSum = a+b;
    }

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

    int sum = max + otherSum;
    System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
    int a= sc.nextInt();
    int b= sc.nextInt();
    int c= sc.nextInt();
    int d= sc.nextInt();

    int max = a;
    int otherSum = b+c;

    if(max < b){
      max = b;
      otherSum = a+c;
    }

    if(max < c){
      max = c;
      otherSum = a+b;
    }

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

    int sum = max + otherSum;
    System.out.println(sum);
	} 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 d= sc.nextInt(); d sc.nextInt() sc.nextInt sc int max = a; max a int otherSum = b+c; otherSum b+c b c if(max < b){
      max = b;
      otherSum = a+c;
    } max < b max b {
      max = b;
      otherSum = a+c;
    } max = b max b otherSum = a+c otherSum a+c a c if(max < c){
      max = c;
      otherSum = a+b;
    } max < c max c {
      max = c;
      otherSum = a+b;
    } max = c max c otherSum = a+b otherSum a+b a b for(int i=0; i<d; i++){
  		max = max*2;
  	} int i=0; int i=0; i 0 i<d i d i++ i++ i {
  		max = max*2;
  	} {
  		max = max*2;
  	} max = max*2 max max*2 max 2 int sum = max + otherSum; sum max + otherSum max otherSum System.out.println(sum) System.out.println System.out System System.out sum String args[] args
import java.util.*;
 
class Main{
	public static void main(String args[]) throws Exception{
		Scanner sc = new Scanner(System.in);
    int a= sc.nextInt();
    int b= sc.nextInt();
    int c= sc.nextInt();
    int d= sc.nextInt();

    int max = a;
    int otherSum = b+c;

    if(max < b){
      max = b;
      otherSum = a+c;
    }

    if(max < c){
      max = c;
      otherSum = a+b;
    }

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

    int sum = max + otherSum;
    System.out.println(sum);
	}
}