OI XXXII - usu

// https://szkopul.edu.pl/problemset/problem/W8B2SfdW3eGzE3n-vOuHrT3W/site/?key=statement

#include <bits/stdc++.h>

using namespace std;

#define int long long

constexpr int sizik = 1000 * 1001;

#define ar std::array
#define pr std::pair
#define vec std::vector

typedef vec<vec<int>> _kra;

void solve() {
    int a, b;
    std::cin >> a >> b;

    int x = b - a + 1;

    if (x % 4 == 0) {
        std::cout << x << '\n';
    } else if (x % 4 == 1) {
        std::cout << x - 1 << '\n';
    } else if (x % 4 == 2) {
        std::cout << x - 2 << '\n';
    } else if (x % 4 == 3) {
        std::cout << x - 1 << '\n';
    }
}

int32_t main() {
    std::ios_base::sync_with_stdio(0);
    std::cin.tie(0);
    std::cout.tie(0);

    int t = 1;
    // std::cin >> t;

    for (; t > 0; t--) {
        solve();
    }

    return 0;
}