public static void main ( String args [ ] ) throws IOException {
  Scanner in = new Scanner ( System . in ) ;
  int n = in . nextInt ( ) ;
  int d = in . nextInt ( ) ;
  int x [ ] = new int [ n ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) x [ i ] = in . nextInt ( ) ;
  int i = 1 , c = 0 ;
  while ( i < n ) {
    if ( x [ i - 1 ] < x [ i ] ) i ++ ;
    else if ( x [ i ] <= x [ i - 1 ] ) {
      double z = ( double ) ( ( x [ i - 1 ] - x [ i ] ) / ( double ) d ) ;
      if ( z == 0.0 ) z = 1.0 ;
      c += ( int ) ( Math . ceil ( z ) ) ;
      x [ i ] += ( d * ( ( int ) ( Math . ceil ( z ) ) ) ) ;
      if ( x [ i ] == x [ i - 1 ] ) {
        c += 1 ;
        x [ i ] += d ;
      }
      i ++ ;
    }
  }
  System . out . println ( c ) ;
}

public static void main ( String args [ ] ) throws IOException { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int d = in . nextInt ( ) ; int x [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) x [ i ] = in . nextInt ( ) ; int i = 1 , c = 0 ; while ( i < n ) { if ( x [ i - 1 ] < x [ i ] ) i ++ ; else if ( x [ i ] <= x [ i - 1 ] ) { double z = ( double ) ( ( x [ i - 1 ] - x [ i ] ) / ( double ) d ) ; if ( z == 0.0 ) z = 1.0 ; c += ( int ) ( Math . ceil ( z ) ) ; x [ i ] += ( d * ( ( int ) ( Math . ceil ( z ) ) ) ) ; if ( x [ i ] == x [ i - 1 ] ) { c += 1 ; x [ i ] += d ; } i ++ ; } } System . out . println ( c ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (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 (field_access object: (identifier) field: (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) dimensions: (dimensions) 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: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier)))) consequence: (expression_statement (update_expression (identifier))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier)))) right: (cast_expression type: (floating_point_type) value: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_floating_point_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_floating_point_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (cast_expression type: (integral_type) value: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))) (expression_statement (update_expression (identifier)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))