import 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 answer=0;
    int max=a;
    int other1=b;
    int other2=c;
    if(b>max){
      max=b;
      other1=a;
      other2=c;
    }
    if(c>max){
      max=c;
      other1=a;
      other2=b;
    }
    for(int i=0;i<k;i++){
      max *= 2;
    }
    System.out.print(max+other1+other2);
  }
} import java.util.*; util.* java 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 answer=0;
    int max=a;
    int other1=b;
    int other2=c;
    if(b>max){
      max=b;
      other1=a;
      other2=c;
    }
    if(c>max){
      max=c;
      other1=a;
      other2=b;
    }
    for(int i=0;i<k;i++){
      max *= 2;
    }
    System.out.print(max+other1+other2);
  }
} 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 answer=0;
    int max=a;
    int other1=b;
    int other2=c;
    if(b>max){
      max=b;
      other1=a;
      other2=c;
    }
    if(c>max){
      max=c;
      other1=a;
      other2=b;
    }
    for(int i=0;i<k;i++){
      max *= 2;
    }
    System.out.print(max+other1+other2);
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();
    int answer=0;
    int max=a;
    int other1=b;
    int other2=c;
    if(b>max){
      max=b;
      other1=a;
      other2=c;
    }
    if(c>max){
      max=c;
      other1=a;
      other2=b;
    }
    for(int i=0;i<k;i++){
      max *= 2;
    }
    System.out.print(max+other1+other2);
  } 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 answer=0; answer 0 int max=a; max a int other1=b; other1 b int other2=c; other2 c if(b>max){
      max=b;
      other1=a;
      other2=c;
    } b>max b max {
      max=b;
      other1=a;
      other2=c;
    } max=b max b other1=a other1 a other2=c other2 c if(c>max){
      max=c;
      other1=a;
      other2=b;
    } c>max c max {
      max=c;
      other1=a;
      other2=b;
    } max=c max c other1=a other1 a other2=b other2 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.print(max+other1+other2) System.out.print System.out System System.out max+other1+other2 max+other1+other2 max other1 other2 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 answer=0;
    int max=a;
    int other1=b;
    int other2=c;
    if(b>max){
      max=b;
      other1=a;
      other2=c;
    }
    if(c>max){
      max=c;
      other1=a;
      other2=b;
    }
    for(int i=0;i<k;i++){
      max *= 2;
    }
    System.out.print(max+other1+other2);
  }
} 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 answer=0;
    int max=a;
    int other1=b;
    int other2=c;
    if(b>max){
      max=b;
      other1=a;
      other2=c;
    }
    if(c>max){
      max=c;
      other1=a;
      other2=b;
    }
    for(int i=0;i<k;i++){
      max *= 2;
    }
    System.out.print(max+other1+other2);
  }
} Main
import 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 answer=0;
    int max=a;
    int other1=b;
    int other2=c;
    if(b>max){
      max=b;
      other1=a;
      other2=c;
    }
    if(c>max){
      max=c;
      other1=a;
      other2=b;
    }
    for(int i=0;i<k;i++){
      max *= 2;
    }
    System.out.print(max+other1+other2);
  }
}
