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 max = a;
int cd=0;

if(b > max) {
	max = b;
	cd = 1;	
}

if(c > max){
	max =c;
	cd =2;
}

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

if(cd == 0){
  max = max+b+c;
} else if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
}

System.out.println(max);

}
} 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 max = a;
int cd=0;

if(b > max) {
	max = b;
	cd = 1;	
}

if(c > max){
	max =c;
	cd =2;
}

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

if(cd == 0){
  max = max+b+c;
} else if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
}

System.out.println(max);

}
} 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 max = a;
int cd=0;

if(b > max) {
	max = b;
	cd = 1;	
}

if(c > max){
	max =c;
	cd =2;
}

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

if(cd == 0){
  max = max+b+c;
} else if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
}

System.out.println(max);

} main {
Scanner sc = new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
int k=sc.nextInt();

int max = a;
int cd=0;

if(b > max) {
	max = b;
	cd = 1;	
}

if(c > max){
	max =c;
	cd =2;
}

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

if(cd == 0){
  max = max+b+c;
} else if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
}

System.out.println(max);

} 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 max = a; max a int cd=0; cd 0 if(b > max) {
	max = b;
	cd = 1;	
} b > max b max {
	max = b;
	cd = 1;	
} max = b max b cd = 1 cd 1 if(c > max){
	max =c;
	cd =2;
} c > max c max {
	max =c;
	cd =2;
} max =c max c cd =2 cd 2 for(int i = 0; i < k; i++) {
max = max *2;
} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
max = max *2;
} {
max = max *2;
} max = max *2 max max *2 max 2 if(cd == 0){
  max = max+b+c;
} else if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
} cd == 0 cd 0 {
  max = max+b+c;
} max = max+b+c max max+b+c max+b+c max b c if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
} cd ==1 cd 1 {
	max= max+a+c;
} max= max+a+c max max+a+c max+a+c max a c if(cd == 2) {
	max =max+a+b;
} cd == 2 cd 2 {
	max =max+a+b;
} max =max+a+b max max+a+b max+a+b max a b System.out.println(max) System.out.println System.out System System.out max 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 max = a;
int cd=0;

if(b > max) {
	max = b;
	cd = 1;	
}

if(c > max){
	max =c;
	cd =2;
}

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

if(cd == 0){
  max = max+b+c;
} else if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
}

System.out.println(max);

}
} 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 max = a;
int cd=0;

if(b > max) {
	max = b;
	cd = 1;	
}

if(c > max){
	max =c;
	cd =2;
}

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

if(cd == 0){
  max = max+b+c;
} else if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
}

System.out.println(max);

}
} 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 max = a;
int cd=0;

if(b > max) {
	max = b;
	cd = 1;	
}

if(c > max){
	max =c;
	cd =2;
}

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

if(cd == 0){
  max = max+b+c;
} else if(cd ==1) {
	max= max+a+c;
} else if(cd == 2) {
	max =max+a+b;
}

System.out.println(max);

}
}
