public static void main ( String [ ] $ ) {
  Scanner sc = new Scanner ( in ) ;
  int x = sc . nextInt ( ) ;
  int y = sc . nextInt ( ) ;
  int ans1 = ( int ) 1e9 + 4 ;
  int ans2 = ( int ) 1e9 + 4 ;
  int ans3 = ( int ) 1e9 + 4 ;
  int ans4 = ( int ) 1e9 + 4 ;
  if ( - x <= - y ) ans1 = - y + x + 2 ;
  if ( - x <= y ) ans2 = y + x + 1 ;
  if ( x <= y ) ans3 = y - x ;
  if ( x <= - y ) ans4 = - y - x + 1 ;
  out . println ( min ( min ( ans1 , ans2 ) , min ( ans3 , ans4 ) ) ) ;
}

public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int ans1 = ( int ) 1e9 + 4 ; int ans2 = ( int ) 1e9 + 4 ; int ans3 = ( int ) 1e9 + 4 ; int ans4 = ( int ) 1e9 + 4 ; if ( - x <= - y ) ans1 = - y + x + 2 ; if ( - x <= y ) ans2 = y + x + 1 ; if ( x <= y ) ans3 = y - x ; if ( x <= - y ) ans4 = - y - x + 1 ; out . println ( min ( min ( ans1 , ans2 ) , min ( ans3 , ans4 ) ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (cast_expression type: (integral_type) value: (decimal_floating_point_literal)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (cast_expression type: (integral_type) value: (decimal_floating_point_literal)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (cast_expression type: (integral_type) value: (decimal_floating_point_literal)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (cast_expression type: (integral_type) value: (decimal_floating_point_literal)) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (unary_expression operand: (identifier)) right: (unary_expression operand: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (unary_expression operand: (identifier)) right: (identifier)) right: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (unary_expression operand: (identifier)) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (unary_expression operand: (identifier)) right: (identifier)) right: (decimal_integer_literal))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))) (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))))))))