static long c ( int [ ] a ) {
  long [ ] [ ] [ ] dp = new long [ 20 ] [ 2 ] [ 2 ] ;
  dp [ 0 ] [ 0 ] [ 0 ] = 1 ;
  for ( int i = 0 ;
  i < 19 ;
  i ++ ) {
    for ( int j = 0 ;
    j < 2 ;
    j ++ ) {
      int x = j == 1 ? 9 : a [ i ] ;
      for ( int k = 0 ;
      k < 2 ;
      k ++ ) {
        for ( int l = 0 ;
        l <= x ;
        l ++ ) {
          dp [ i + 1 ] [ j == 1 || l < x ? 1 : 0 ] [ l == 4 || l == 9 ? 1 : k ] += dp [ i ] [ j ] [ k ] ;
        }
      }
    }
  }
  return dp [ 19 ] [ 0 ] [ 1 ] + dp [ 19 ] [ 1 ] [ 1 ] ;
}

static long c ( int [ ] a ) { long [ ] [ ] [ ] dp = new long [ 20 ] [ 2 ] [ 2 ] ; dp [ 0 ] [ 0 ] [ 0 ] = 1 ; for ( int i = 0 ; i < 19 ; i ++ ) { for ( int j = 0 ; j < 2 ; j ++ ) { int x = j == 1 ? 9 : a [ i ] ; for ( int k = 0 ; k < 2 ; k ++ ) { for ( int l = 0 ; l <= x ; l ++ ) { dp [ i + 1 ] [ j == 1 || l < x ? 1 : 0 ] [ l == 4 || l == 9 ? 1 : k ] += dp [ i ] [ j ] [ k ] ; } } } } return dp [ 19 ] [ 0 ] [ 1 ] + dp [ 19 ] [ 1 ] [ 1 ] ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (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 (decimal_integer_literal)) dimensions: (dimensions_expr (decimal_integer_literal)) dimensions: (dimensions_expr (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (decimal_integer_literal)) index: (decimal_integer_literal)) right: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (ternary_expression condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) consequence: (decimal_integer_literal) alternative: (array_access array: (identifier) index: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (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 (expression_statement (assignment_expression left: (array_access array: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (ternary_expression condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier))) consequence: (decimal_integer_literal) alternative: (decimal_integer_literal))) index: (ternary_expression condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (decimal_integer_literal) alternative: (identifier))) right: (array_access array: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) index: (identifier)))))))))))) (return_statement (binary_expression left: (array_access array: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (decimal_integer_literal)) index: (decimal_integer_literal)) right: (array_access array: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (decimal_integer_literal)) index: (decimal_integer_literal))))))