import java.util.*;
class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int[] a = new int[3];
	for(int i = 0; i<3; i++) {
	    a[i] = sc.nextInt();
	}
	Arrays.sort(a);
	long sum = 0;
	for(int i = 0; i<3; i++) {
	    if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    }
	    sum += a[i];
	}
	System.out.println(sum);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int[] a = new int[3];
	for(int i = 0; i<3; i++) {
	    a[i] = sc.nextInt();
	}
	Arrays.sort(a);
	long sum = 0;
	for(int i = 0; i<3; i++) {
	    if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    }
	    sum += a[i];
	}
	System.out.println(sum);
    }
} Main public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int[] a = new int[3];
	for(int i = 0; i<3; i++) {
	    a[i] = sc.nextInt();
	}
	Arrays.sort(a);
	long sum = 0;
	for(int i = 0; i<3; i++) {
	    if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    }
	    sum += a[i];
	}
	System.out.println(sum);
    } main {
	Scanner sc = new Scanner(System.in);
	int[] a = new int[3];
	for(int i = 0; i<3; i++) {
	    a[i] = sc.nextInt();
	}
	Arrays.sort(a);
	long sum = 0;
	for(int i = 0; i<3; i++) {
	    if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    }
	    sum += a[i];
	}
	System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[3]; a new int[3] 3 for(int i = 0; i<3; i++) {
	    a[i] = sc.nextInt();
	} int i = 0; int i = 0; i 0 i<3 i 3 i++ i++ i {
	    a[i] = sc.nextInt();
	} {
	    a[i] = sc.nextInt();
	} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc Arrays.sort(a) Arrays.sort Arrays a long sum = 0; sum 0 for(int i = 0; i<3; i++) {
	    if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    }
	    sum += a[i];
	} int i = 0; int i = 0; i 0 i<3 i 3 i++ i++ i {
	    if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    }
	    sum += a[i];
	} {
	    if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    }
	    sum += a[i];
	} if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    } i == 2 i 2 {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc while(n>0) {
		    a[i] *= 2;
		    n--;
		} n>0 n 0 {
		    a[i] *= 2;
		    n--;
		} a[i] *= 2 a[i] a i 2 n-- n sum += a[i] sum a[i] a i 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) {
	Scanner sc = new Scanner(System.in);
	int[] a = new int[3];
	for(int i = 0; i<3; i++) {
	    a[i] = sc.nextInt();
	}
	Arrays.sort(a);
	long sum = 0;
	for(int i = 0; i<3; i++) {
	    if(i == 2) {
		int n = sc.nextInt();
		while(n>0) {
		    a[i] *= 2;
		    n--;
		}
	    }
	    sum += a[i];
	}
	System.out.println(sum);
    }
}