public static void main ( String args [ ] ) {
  Scanner in = new Scanner ( System . in ) ;
  long x [ ] = new long [ 3 ] ;
  x [ 0 ] = in . nextLong ( ) ;
  x [ 1 ] = in . nextLong ( ) ;
  x [ 2 ] = in . nextLong ( ) ;
  Arrays . sort ( x ) ;
  long k = in . nextLong ( ) ;
  if ( x [ 0 ] == x [ 1 ] && x [ 1 ] == x [ 2 ] && x [ 2 ] == 1 ) {
    System . out . println ( 1 ) ;
    return ;
  }
  long a = Math . min ( x [ 0 ] - 1 , k / 3 ) ;
  long b = Math . min ( x [ 1 ] - 1 , k / 3 ) ;
  long c = Math . min ( x [ 2 ] - 1 , k / 3 ) ;
  k = k - a - b - c ;
  if ( k == 0 ) {
    System . out . println ( ( a + 1 ) * ( b + 1 ) * ( c + 1 ) ) ;
  }
  else {
    if ( b == x [ 1 ] - 1 ) {
      c += Math . min ( k , x [ 2 ] - 1 - c ) ;
    }
    else {
      long d = Math . min ( k / 2 , x [ 1 ] - 1 - b ) ;
      b += d ;
      k -= d ;
      c += Math . min ( k , x [ 2 ] - 1 - c ) ;
    }
    System . out . println ( ( a + 1 ) * ( b + 1 ) * ( c + 1 ) ) ;
  }
}

public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; long x [ ] = new long [ 3 ] ; x [ 0 ] = in . nextLong ( ) ; x [ 1 ] = in . nextLong ( ) ; x [ 2 ] = in . nextLong ( ) ; Arrays . sort ( x ) ; long k = in . nextLong ( ) ; if ( x [ 0 ] == x [ 1 ] && x [ 1 ] == x [ 2 ] && x [ 2 ] == 1 ) { System . out . println ( 1 ) ; return ; } long a = Math . min ( x [ 0 ] - 1 , k / 3 ) ; long b = Math . min ( x [ 1 ] - 1 , k / 3 ) ; long c = Math . min ( x [ 2 ] - 1 , k / 3 ) ; k = k - a - b - c ; if ( k == 0 ) { System . out . println ( ( a + 1 ) * ( b + 1 ) * ( c + 1 ) ) ; } else { if ( b == x [ 1 ] - 1 ) { c += Math . min ( k , x [ 2 ] - 1 - c ) ; } else { long d = Math . min ( k / 2 , x [ 1 ] - 1 - b ) ; b += d ; k -= d ; c += Math . min ( k , x [ 2 ] - 1 - c ) ; } System . out . println ( ( a + 1 ) * ( b + 1 ) * ( c + 1 ) ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (return_statement))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (identifier))))))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (identifier)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))))))))