static long f ( char [ ] v , int idx ) {
  if ( idx == v . length ) return 0 ;
  long ret = 0 ;
  for ( int i = 0 ;
  i < v [ idx ] - '0' ;
  ++ i ) {
    if ( i == 4 || i == 9 ) continue ;
    ret += pow ( 8 , v . length - 1 - idx ) ;
  }
  if ( v [ idx ] - '0' != 4 && v [ idx ] - '0' != 9 ) ret += f ( v , idx + 1 ) ;
  return ret ;
}

static long f ( char [ ] v , int idx ) { if ( idx == v . length ) return 0 ; long ret = 0 ; for ( int i = 0 ; i < v [ idx ] - '0' ; ++ i ) { if ( i == 4 || i == 9 ) continue ; ret += pow ( 8 , v . length - 1 - idx ) ; } if ( v [ idx ] - '0' != 4 && v [ idx ] - '0' != 9 ) ret += f ( v , idx + 1 ) ; return ret ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) consequence: (return_statement (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (continue_statement)) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)) right: (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)) right: (decimal_integer_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (return_statement (identifier))))