def main():
    a, b = map(int, input().split())

    # if the number of 1 is odd: 1
    # else: 0
    b += 1
    ans = 0
    unit = 1
    for i in range(b.bit_length()):
        new_unit = unit << 1
        cnt = min(new_unit - a % new_unit, unit) % 2
        cnt += max(0, b % new_unit - unit) % 2
        cnt %= 2
        if cnt:
            ans += unit

        unit = new_unit

    if (b - a) % 2 == 0:
        if ((b - a) // 2) % 2 == 0:
            ans -= 1
    else:
        if a % 2 == 1:
            if ((b - a + 1) // 2) % 2 == 0:
                ans -= 1
        else:
            if ((b - a - 1) // 2) % 2 == 0:
                ans -= 1

    print(ans)

main() def main():
    a, b = map(int, input().split())

    # if the number of 1 is odd: 1
    # else: 0
    b += 1
    ans = 0
    unit = 1
    for i in range(b.bit_length()):
        new_unit = unit << 1
        cnt = min(new_unit - a % new_unit, unit) % 2
        cnt += max(0, b % new_unit - unit) % 2
        cnt %= 2
        if cnt:
            ans += unit

        unit = new_unit

    if (b - a) % 2 == 0:
        if ((b - a) // 2) % 2 == 0:
            ans -= 1
    else:
        if a % 2 == 1:
            if ((b - a + 1) // 2) % 2 == 0:
                ans -= 1
        else:
            if ((b - a - 1) // 2) % 2 == 0:
                ans -= 1

    print(ans) main a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b b += 1 b 1 ans = 0 ans 0 unit = 1 unit 1 for i in range(b.bit_length()):
        new_unit = unit << 1
        cnt = min(new_unit - a % new_unit, unit) % 2
        cnt += max(0, b % new_unit - unit) % 2
        cnt %= 2
        if cnt:
            ans += unit

        unit = new_unit

     i range(b.bit_length()) range b.bit_length() b.bit_length b bit_length new_unit = unit << 1 new_unit unit << 1 unit 1 cnt = min(new_unit - a % new_unit, unit) % 2 cnt min(new_unit - a % new_unit, unit) % 2 min(new_unit - a % new_unit, unit) min new_unit - a % new_unit new_unit a % new_unit a new_unit unit 2 cnt += max(0, b % new_unit - unit) % 2 cnt max(0, b % new_unit - unit) % 2 max(0, b % new_unit - unit) max 0 b % new_unit - unit b % new_unit b new_unit unit 2 cnt %= 2 cnt 2 if cnt:
            ans += unit

         cnt ans += unit ans unit unit = new_unit unit new_unit if (b - a) % 2 == 0:
        if ((b - a) // 2) % 2 == 0:
            ans -= 1
    else:
        if a % 2 == 1:
            if ((b - a + 1) // 2) % 2 == 0:
                ans -= 1
        else:
            if ((b - a - 1) // 2) % 2 == 0:
                ans -= 1

     (b - a) % 2 == 0 (b - a) % 2 b - a b a 2 0 if ((b - a) // 2) % 2 == 0:
            ans -= 1
     ((b - a) // 2) % 2 == 0 ((b - a) // 2) % 2 (b - a) // 2 b - a b a 2 2 0 ans -= 1 ans 1 if a % 2 == 1:
            if ((b - a + 1) // 2) % 2 == 0:
                ans -= 1
        else:
            if ((b - a - 1) // 2) % 2 == 0:
                ans -= 1

     a % 2 == 1 a % 2 a 2 1 if ((b - a + 1) // 2) % 2 == 0:
                ans -= 1
         ((b - a + 1) // 2) % 2 == 0 ((b - a + 1) // 2) % 2 (b - a + 1) // 2 b - a + 1 b - a b a 1 2 2 0 ans -= 1 ans 1 if ((b - a - 1) // 2) % 2 == 0:
                ans -= 1

     ((b - a - 1) // 2) % 2 == 0 ((b - a - 1) // 2) % 2 (b - a - 1) // 2 b - a - 1 b - a b a 1 2 2 0 ans -= 1 ans 1 print(ans) print ans main() main def main():
    a, b = map(int, input().split())

    # if the number of 1 is odd: 1
    # else: 0
    b += 1
    ans = 0
    unit = 1
    for i in range(b.bit_length()):
        new_unit = unit << 1
        cnt = min(new_unit - a % new_unit, unit) % 2
        cnt += max(0, b % new_unit - unit) % 2
        cnt %= 2
        if cnt:
            ans += unit

        unit = new_unit

    if (b - a) % 2 == 0:
        if ((b - a) // 2) % 2 == 0:
            ans -= 1
    else:
        if a % 2 == 1:
            if ((b - a + 1) // 2) % 2 == 0:
                ans -= 1
        else:
            if ((b - a - 1) // 2) % 2 == 0:
                ans -= 1

    print(ans) def main():
    a, b = map(int, input().split())

    # if the number of 1 is odd: 1
    # else: 0
    b += 1
    ans = 0
    unit = 1
    for i in range(b.bit_length()):
        new_unit = unit << 1
        cnt = min(new_unit - a % new_unit, unit) % 2
        cnt += max(0, b % new_unit - unit) % 2
        cnt %= 2
        if cnt:
            ans += unit

        unit = new_unit

    if (b - a) % 2 == 0:
        if ((b - a) // 2) % 2 == 0:
            ans -= 1
    else:
        if a % 2 == 1:
            if ((b - a + 1) // 2) % 2 == 0:
                ans -= 1
        else:
            if ((b - a - 1) // 2) % 2 == 0:
                ans -= 1

    print(ans) main
def main():
    a, b = map(int, input().split())

    # if the number of 1 is odd: 1
    # else: 0
    b += 1
    ans = 0
    unit = 1
    for i in range(b.bit_length()):
        new_unit = unit << 1
        cnt = min(new_unit - a % new_unit, unit) % 2
        cnt += max(0, b % new_unit - unit) % 2
        cnt %= 2
        if cnt:
            ans += unit

        unit = new_unit

    if (b - a) % 2 == 0:
        if ((b - a) // 2) % 2 == 0:
            ans -= 1
    else:
        if a % 2 == 1:
            if ((b - a + 1) // 2) % 2 == 0:
                ans -= 1
        else:
            if ((b - a - 1) // 2) % 2 == 0:
                ans -= 1

    print(ans)

main()