import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Long> list = new ArrayList<>();
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	int K = Integer.parseInt(sc.next());
    sc.close();
    int s = list.size();
    long c;
    int p;
    
    Collections.sort(list);
    for(int i = 0; i< K; i++){
      c = list.get(s-1);
      list.set(s-1 , c*2);
    }
    c = 0;
    for(int i = 0; i< s; i++){
      c += list.get(i);
    }
    
    System.out.println(c);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Long> list = new ArrayList<>();
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	int K = Integer.parseInt(sc.next());
    sc.close();
    int s = list.size();
    long c;
    int p;
    
    Collections.sort(list);
    for(int i = 0; i< K; i++){
      c = list.get(s-1);
      list.set(s-1 , c*2);
    }
    c = 0;
    for(int i = 0; i< s; i++){
      c += list.get(i);
    }
    
    System.out.println(c);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Long> list = new ArrayList<>();
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	int K = Integer.parseInt(sc.next());
    sc.close();
    int s = list.size();
    long c;
    int p;
    
    Collections.sort(list);
    for(int i = 0; i< K; i++){
      c = list.get(s-1);
      list.set(s-1 , c*2);
    }
    c = 0;
    for(int i = 0; i< s; i++){
      c += list.get(i);
    }
    
    System.out.println(c);
  } main {
    Scanner sc = new Scanner(System.in);
    List<Long> list = new ArrayList<>();
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	int K = Integer.parseInt(sc.next());
    sc.close();
    int s = list.size();
    long c;
    int p;
    
    Collections.sort(list);
    for(int i = 0; i< K; i++){
      c = list.get(s-1);
      list.set(s-1 , c*2);
    }
    c = 0;
    for(int i = 0; i< s; i++){
      c += list.get(i);
    }
    
    System.out.println(c);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Long> list = new ArrayList<>(); list new ArrayList<>() list.add(Long.parseLong(sc.next())) list.add list Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc list.add(Long.parseLong(sc.next())) list.add list Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc list.add(Long.parseLong(sc.next())) list.add list Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc int K = Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc int s = list.size(); s list.size() list.size list long c; c int p; p Collections.sort(list) Collections.sort Collections list for(int i = 0; i< K; i++){
      c = list.get(s-1);
      list.set(s-1 , c*2);
    } int i = 0; int i = 0; i 0 i< K i K i++ i++ i {
      c = list.get(s-1);
      list.set(s-1 , c*2);
    } {
      c = list.get(s-1);
      list.set(s-1 , c*2);
    } c = list.get(s-1) c list.get(s-1) list.get list s-1 s 1 list.set(s-1 , c*2) list.set list s-1 s 1 c*2 c 2 c = 0 c 0 for(int i = 0; i< s; i++){
      c += list.get(i);
    } int i = 0; int i = 0; i 0 i< s i s i++ i++ i {
      c += list.get(i);
    } {
      c += list.get(i);
    } c += list.get(i) c list.get(i) list.get list i System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Long> list = new ArrayList<>();
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	int K = Integer.parseInt(sc.next());
    sc.close();
    int s = list.size();
    long c;
    int p;
    
    Collections.sort(list);
    for(int i = 0; i< K; i++){
      c = list.get(s-1);
      list.set(s-1 , c*2);
    }
    c = 0;
    for(int i = 0; i< s; i++){
      c += list.get(i);
    }
    
    System.out.println(c);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Long> list = new ArrayList<>();
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	int K = Integer.parseInt(sc.next());
    sc.close();
    int s = list.size();
    long c;
    int p;
    
    Collections.sort(list);
    for(int i = 0; i< K; i++){
      c = list.get(s-1);
      list.set(s-1 , c*2);
    }
    c = 0;
    for(int i = 0; i< s; i++){
      c += list.get(i);
    }
    
    System.out.println(c);
  }
} Main
import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Long> list = new ArrayList<>();
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	list.add(Long.parseLong(sc.next()));
	int K = Integer.parseInt(sc.next());
    sc.close();
    int s = list.size();
    long c;
    int p;
    
    Collections.sort(list);
    for(int i = 0; i< K; i++){
      c = list.get(s-1);
      list.set(s-1 , c*2);
    }
    c = 0;
    for(int i = 0; i< s; i++){
      c += list.get(i);
    }
    
    System.out.println(c);
  }
}