public static void main ( String [ ] args ) throws Exception {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  int [ ] yo = Arrays . asList ( br . readLine ( ) . split ( " " ) ) . stream ( ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ;
  int r = yo [ 0 ] ;
  int g = yo [ 1 ] ;
  int b = yo [ 2 ] ;
  long ans = 1252521830252521L ;
  final int OH = 1500 ;
  int [ ] arr = new int [ OH ] ;
  for ( int gl = - 1000 ;
  gl <= 700 ;
  gl ++ ) {
    long cnt = 0 ;
    for ( int i = 0 ;
    i < g ;
    i ++ ) {
      cnt += Math . abs ( gl + i ) ;
    }
    {
      for ( int i = 0 ;
      i < OH ;
      i ++ ) {
        int p = gl - 1 - i ;
        arr [ i ] = Math . abs ( p - ( - 100 ) ) ;
      }
      Arrays . sort ( arr ) ;
      for ( int i = 0 ;
      i < r ;
      i ++ ) {
        cnt += arr [ i ] ;
      }
    }
    {
      for ( int i = 0 ;
      i < OH ;
      i ++ ) {
        int p = gl + g + i ;
        arr [ i ] = Math . abs ( p - ( 100 ) ) ;
      }
      Arrays . sort ( arr ) ;
      for ( int i = 0 ;
      i < b ;
      i ++ ) {
        cnt += arr [ i ] ;
      }
    }
    ans = Math . min ( ans , cnt ) ;
  }
  System . out . println ( ans ) ;
}

public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int [ ] yo = Arrays . asList ( br . readLine ( ) . split ( " ▁ " ) ) . stream ( ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; int r = yo [ 0 ] ; int g = yo [ 1 ] ; int b = yo [ 2 ] ; long ans = 1252521830252521L ; final int OH = 1500 ; int [ ] arr = new int [ OH ] ; for ( int gl = - 1000 ; gl <= 700 ; gl ++ ) { long cnt = 0 ; for ( int i = 0 ; i < g ; i ++ ) { cnt += Math . abs ( gl + i ) ; } { for ( int i = 0 ; i < OH ; i ++ ) { int p = gl - 1 - i ; arr [ i ] = Math . abs ( p - ( - 100 ) ) ; } Arrays . sort ( arr ) ; for ( int i = 0 ; i < r ; i ++ ) { cnt += arr [ i ] ; } } { for ( int i = 0 ; i < OH ; i ++ ) { int p = gl + g + i ; arr [ i ] = Math . abs ( p - ( 100 ) ) ; } Arrays . sort ( arr ) ; for ( int i = 0 ; i < b ; i ++ ) { cnt += arr [ i ] ; } } ans = Math . min ( ans , cnt ) ; } System . out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list (string_literal))))) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list (method_reference (identifier) (identifier)))) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration (modifiers) type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))))) (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (parenthesized_expression (unary_expression operand: (decimal_integer_literal)))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))) (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (parenthesized_expression (decimal_integer_literal))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))