public static void main ( String [ ] args ) throws IOException {
  FastScanner fs = new FastScanner ( ) ;
  PrintWriter out = new PrintWriter ( System . out ) ;
  int tt = 1 ;
  while ( tt -- > 0 ) {
    int hy = fs . nextInt ( ) , ay = fs . nextInt ( ) , dy = fs . nextInt ( ) ;
    int hm = fs . nextInt ( ) , am = fs . nextInt ( ) , dm = fs . nextInt ( ) ;
    int H = fs . nextInt ( ) , A = fs . nextInt ( ) , D = fs . nextInt ( ) ;
    int min = ( int ) 1e9 ;
    for ( int atk = ay ;
    atk <= 200 ;
    atk ++ ) {
      for ( int def = dy ;
      def <= 100 ;
      def ++ ) {
        if ( atk <= dm ) continue ;
        int t = ( hm + atk - dm - 1 ) / ( atk - dm ) ;
        int reqhp = t * Math . max ( 0 , am - def ) + 1 ;
        int coins = ( atk - ay ) * A + ( def - dy ) * D + Math . max ( 0 , reqhp - hy ) * H ;
        if ( coins < min ) {
          min = coins ;
        }
      }
    }
    out . println ( min ) ;
  }
  out . close ( ) ;
}

public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tt = 1 ; while ( tt -- > 0 ) { int hy = fs . nextInt ( ) , ay = fs . nextInt ( ) , dy = fs . nextInt ( ) ; int hm = fs . nextInt ( ) , am = fs . nextInt ( ) , dm = fs . nextInt ( ) ; int H = fs . nextInt ( ) , A = fs . nextInt ( ) , D = fs . nextInt ( ) ; int min = ( int ) 1e9 ; for ( int atk = ay ; atk <= 200 ; atk ++ ) { for ( int def = dy ; def <= 100 ; def ++ ) { if ( atk <= dm ) continue ; int t = ( hm + atk - dm - 1 ) / ( atk - dm ) ; int reqhp = t * Math . max ( 0 , am - def ) + 1 ; int coins = ( atk - ay ) * A + ( def - dy ) * D + Math . max ( 0 , reqhp - hy ) * H ; if ( coins < min ) { min = coins ; } } } out . println ( min ) ; } out . close ( ) ; }
(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)))) (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) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (update_expression (identifier)) right: (decimal_integer_literal))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) 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))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) 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))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) 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: (cast_expression type: (integral_type) value: (decimal_floating_point_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (continue_statement)) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (identifier))))) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier))) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (identifier)))) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))