static long f ( long a ) {
  int [ ] d = new int [ 19 ] ;
  long b = a ;
  for ( int i = 0 ;
  i < 19 ;
  ++ i ) {
    d [ 18 - i ] = ( int ) ( a % 10 ) ;
    a /= 10 ;
  }
  long [ ] dp = new long [ 20 ] ;
  boolean f = false ;
  for ( int i = 0 ;
  i < 19 ;
  ++ i ) {
    dp [ i + 1 ] = 8 * dp [ i ] ;
    for ( int k = d [ i ] + 1 ;
    k < 10 ;
    ++ k ) {
      if ( k != 4 && k != 9 && ! f ) dp [ i + 1 ] -- ;
    }
    if ( d [ i ] == 4 || d [ i ] == 9 ) f = true ;
  }
  return b + 1 - dp [ 19 ] ;
}

static long f ( long a ) { int [ ] d = new int [ 19 ] ; long b = a ; for ( int i = 0 ; i < 19 ; ++ i ) { d [ 18 - i ] = ( int ) ( a % 10 ) ; a /= 10 ; } long [ ] dp = new long [ 20 ] ; boolean f = false ; for ( int i = 0 ; i < 19 ; ++ i ) { dp [ i + 1 ] = 8 * dp [ i ] ; for ( int k = d [ i ] + 1 ; k < 10 ; ++ k ) { if ( k != 4 && k != 9 && ! f ) dp [ i + 1 ] -- ; } if ( d [ i ] == 4 || d [ i ] == 9 ) f = true ; } return b + 1 - dp [ 19 ] ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) 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))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (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 (decimal_integer_literal))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (decimal_integer_literal) right: (array_access array: (identifier) index: (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (unary_expression operand: (identifier)))) consequence: (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (true)))))) (return_statement (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))))))