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 x = sc.nextInt();
  int max = a;
  if(max <= b)max = b;
  if(max <= c)max = c;
  System.out.println(a+b+c+(int)(max*Math.pow(2,x) - 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 x = sc.nextInt();
  int max = a;
  if(max <= b)max = b;
  if(max <= c)max = c;
  System.out.println(a+b+c+(int)(max*Math.pow(2,x) - 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 x = sc.nextInt();
  int max = a;
  if(max <= b)max = b;
  if(max <= c)max = c;
  System.out.println(a+b+c+(int)(max*Math.pow(2,x) - max));
} main {
Scanner sc = new Scanner(System.in);
  int a = sc.nextInt();
  int b = sc.nextInt();
  int c = sc.nextInt();
  int x = sc.nextInt();
  int max = a;
  if(max <= b)max = b;
  if(max <= c)max = c;
  System.out.println(a+b+c+(int)(max*Math.pow(2,x) - 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 x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int max = a; max a if(max <= b)max = b; max <= b max b max = b max b if(max <= c)max = c; max <= c max c max = c max c System.out.println(a+b+c+(int)(max*Math.pow(2,x) - max)) System.out.println System.out System System.out a+b+c+(int)(max*Math.pow(2,x) - max) c a+b+c+(int)(max*Math.pow(2,x) - max) a b c (int)(max*Math.pow(2,x) - max) max*Math.pow(2,x) max Math.pow(2,x) Math.pow Math 2 x 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 x = sc.nextInt();
  int max = a;
  if(max <= b)max = b;
  if(max <= c)max = c;
  System.out.println(a+b+c+(int)(max*Math.pow(2,x) - 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 x = sc.nextInt();
  int max = a;
  if(max <= b)max = b;
  if(max <= c)max = c;
  System.out.println(a+b+c+(int)(max*Math.pow(2,x) - 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 x = sc.nextInt();
  int max = a;
  if(max <= b)max = b;
  if(max <= c)max = c;
  System.out.println(a+b+c+(int)(max*Math.pow(2,x) - max));
}}
