/**
 *    author:  [itmo] enot110
 *    created: 2024-11-10 11:58:14
**/
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define forn(i, n) for(int i = 0 ; (i) < (n) ; ++i)
#define eprintf(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define sz(a) ((int)(a).size())
#define all(a) (a).begin(),a.end()
#define pw(x) (1LL<<(x))

using namespace std;

typedef long long ll;
typedef double dbl;
typedef vector<int> vi;
typedef pair<int, int> pi;

const int inf = 1.01e9;
const dbl eps = 1e-9;

/* --- main part --- */





int main()
{
    #ifdef home
        assert(freopen("in", "r", stdin));
        // assert(freopen("out", "w", stdout));
    #endif
    int l, h;
    scanf("%d%d", &l, &h);
    int res;
    if (l % 2 == 1) res = h;
    else res = h / 2 * 2;
    printf("%d\n", res);


    #ifdef home
        eprintf("time = %d ms\n", (int)(clock() * 1000. / CLOCKS_PER_SEC));
    #endif
    return 0;
}