import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int[] v=new int[3];
v[0]=Integer.parseInt(sc.next());
v[1]=Integer.parseInt(sc.next());
v[2]=Integer.parseInt(sc.next());
int K=Integer.parseInt(sc.next());
Arrays.sort(v);
for(int i=0;i<K;i++){
v[2]*=2;
}
System.out.println(v[0]+v[1]+v[2]);
}} import java.util.*; util.* java public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int[] v=new int[3];
v[0]=Integer.parseInt(sc.next());
v[1]=Integer.parseInt(sc.next());
v[2]=Integer.parseInt(sc.next());
int K=Integer.parseInt(sc.next());
Arrays.sort(v);
for(int i=0;i<K;i++){
v[2]*=2;
}
System.out.println(v[0]+v[1]+v[2]);
}} Main public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int[] v=new int[3];
v[0]=Integer.parseInt(sc.next());
v[1]=Integer.parseInt(sc.next());
v[2]=Integer.parseInt(sc.next());
int K=Integer.parseInt(sc.next());
Arrays.sort(v);
for(int i=0;i<K;i++){
v[2]*=2;
}
System.out.println(v[0]+v[1]+v[2]);
} main {
Scanner sc = new Scanner(System.in);
int[] v=new int[3];
v[0]=Integer.parseInt(sc.next());
v[1]=Integer.parseInt(sc.next());
v[2]=Integer.parseInt(sc.next());
int K=Integer.parseInt(sc.next());
Arrays.sort(v);
for(int i=0;i<K;i++){
v[2]*=2;
}
System.out.println(v[0]+v[1]+v[2]);
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] v=new int[3]; v new int[3] 3 v[0]=Integer.parseInt(sc.next()) v[0] v 0 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc v[1]=Integer.parseInt(sc.next()) v[1] v 1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc v[2]=Integer.parseInt(sc.next()) v[2] v 2 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int K=Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(v) Arrays.sort Arrays v for(int i=0;i<K;i++){
v[2]*=2;
} int i=0; int i=0; i 0 i<K i K i++ i++ i {
v[2]*=2;
} {
v[2]*=2;
} v[2]*=2 v[2] v 2 2 System.out.println(v[0]+v[1]+v[2]) System.out.println System.out System System.out v[0]+v[1]+v[2] v[0]+v[1]+v[2] v[0] v 0 v[1] v 1 v[2] v 2 String[] args args public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int[] v=new int[3];
v[0]=Integer.parseInt(sc.next());
v[1]=Integer.parseInt(sc.next());
v[2]=Integer.parseInt(sc.next());
int K=Integer.parseInt(sc.next());
Arrays.sort(v);
for(int i=0;i<K;i++){
v[2]*=2;
}
System.out.println(v[0]+v[1]+v[2]);
}} public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int[] v=new int[3];
v[0]=Integer.parseInt(sc.next());
v[1]=Integer.parseInt(sc.next());
v[2]=Integer.parseInt(sc.next());
int K=Integer.parseInt(sc.next());
Arrays.sort(v);
for(int i=0;i<K;i++){
v[2]*=2;
}
System.out.println(v[0]+v[1]+v[2]);
}} Main
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int[] v=new int[3];
v[0]=Integer.parseInt(sc.next());
v[1]=Integer.parseInt(sc.next());
v[2]=Integer.parseInt(sc.next());
int K=Integer.parseInt(sc.next());
Arrays.sort(v);
for(int i=0;i<K;i++){
v[2]*=2;
}
System.out.println(v[0]+v[1]+v[2]);
}}