import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.functional;

void main() {
    readln.split.to!(long[]).pipe!(tmp => iota(1,64).map!(n => (1L << (n-1L)) & (~((min((1L << n) - tmp[0] % (1L << n), 1L << (n-1)) + max(0, tmp[1] % (1L << n) - (1L << (n-1)) + 1)) & 1) + 1)).sum.writeln);
}

