public static void main ( String [ ] args ) {
  int test = 1 ;
  while ( test -- > 0 ) {
    long a = sc . nextLong ( ) ;
    long b = sc . nextLong ( ) ;
    long p = 0 ;
    long t = b ;
    while ( t > 0 ) {
      p ++ ;
      t = t >> 1 ;
    }
    int count = 0 ;
    boolean flag = false ;
    for ( long i = p ;
    i >= 0 ;
    i -- ) {
      for ( long j = 0 ;
      j < i - 1 ;
      j ++ ) {
        long x = ( ( 1L << i ) - 1 ) - ( 1L << j ) ;
        if ( x >= a && x <= b ) {
          count ++ ;
        }
      }
    }
    out . println ( count ) ;
  }
  out . close ( ) ;
}

public static void main ( String [ ] args ) { int test = 1 ; while ( test -- > 0 ) { long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long p = 0 ; long t = b ; while ( t > 0 ) { p ++ ; t = t >> 1 ; } int count = 0 ; boolean flag = false ; for ( long i = p ; i >= 0 ; i -- ) { for ( long j = 0 ; j < i - 1 ; j ++ ) { long x = ( ( 1L << i ) - 1 ) - ( 1L << j ) ; if ( x >= a && x <= b ) { count ++ ; } } } out . println ( count ) ; } 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))) body: (block (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)))) (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: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (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: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (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: (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (update_expression (identifier))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))