#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"
template<class T> void chmax(T &a, const T b){ a = max(a, b); }
template<class T> void chmin(T &a, const T b){ a = min(a, b); }
long long gcd(long long a, long long b) { return (a % b) ? gcd(b, a % b) : b; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll b, c;
    cin >> b >> c;
    ll b1l = b - c / 2;
    ll b1r = b + (c - 2) / 2;
    ll b2l = -b - (c - 1) / 2;
    ll b2r = -b + (c - 1) / 2;
    ll ans = b1r - b1l + 1 + b2r - b2l + 1;
    if (b1r < b2l) {
        // nop
    }
    else if (b2r < b1l) {
        // nop
    }
    else {
        ans = max(b1r, b2r) - min(b1l, b2l) + 1;
    }
    cout << ans << endl;
    return 0;
}

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <bitset>
#include <map>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>
#include <sstream>
#include <set>
#include <unordered_set>

using namespace std;

#define ll long long
#define ld long double
#define vecint vector<int>
#define vec2int vector<vector<int>>
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecdouble vector<double>
#define vecchar vector<char>
#define vecstr vector<string>
#define vec2str vector<vector<string>>
#define vecbool vector<bool>
#define vec2bool vector<vector<bool>>
#define pairll pair<ll,ll>
#define vecpairll vector<pair<long long,long long>>
#define vec2pairll vector<vector<pair<long long,long long>>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)
#define forbit(s,a) for(int s = 0; s < (1 << a); s++)

#define sortLower(vec) sort(vec.begin(),vec.end())
#define sortGreater(vec,type) sort(vec.begin(),vec.end(),greater<type>())

const ll INF = 1000000000000;
const ld Pi = acos(-1.0);
const ll mod = 1000000007;
const ld EPS = 0.0000000001;

#define out_(s) cout << s << " "
#define out(s) cout << s << "\n"

class UnionFind
{
public:
	vecll par;

	UnionFind(ll n)
	{
		par.resize(n, -1);
	}

	ll root(ll pos)
	{
		if (par[pos] == -1) return pos;
		par[pos] = root(par[pos]);
		return par[pos];
	}

	void unite(ll u, ll v)
	{
		u = root(u); v = root(v);
		if (u == v) return;
		par[u] = v;
	}

	bool same(ll u, ll v)
	{
		if (root(u) == root(v)) return true;
		return false;
	}
};

ll gcd(ll a, ll b)
{
	if (min(a, b) == 0)
		return max(a, b);

	return gcd(min(a, b), max(a, b) % min(a, b));
}

ll lcm(ll a, ll b)
{
	ll buf = gcd(a, b);

	return abs(a * b) / buf;
}

string toBaseNum(ll n, ll base)
{
	string s;

	while (n > 0)
	{
		if (base > 10)
		{
			if (n % base >= 10)
			{
				string buf;
				buf.push_back(n % base - 10 + 'A');
				s = buf + s;
			}
			else
			{
				s = to_string(n % base) + s;
			}
		}
		else
		{
			s = to_string(n % base) + s;
		}
		n /= base;
	}

	if (s.empty())
		s = "0";

	return s;
}

ll toDecNum(string n, ll base)
{
	ll num = 0;

	forll(i, 0, n.size())
	{
		ll buf = 0;
		buf = n[i] >= 'A' ? n[i] - 'A' + 10 : n[i] - '0';
		num += pow(base, n.size() - i - 1) * buf;
	}

	return num;
}

vecpairll primeFactorize(ll n)
{
	vecpairll buf;

	forll(i, 2, sqrt(n + 1))
	{
		if (n % i != 0)
			continue;

		long long ex = 0;

		while (n % i == 0)
		{
			++ex;
			n /= i;
		}

		buf.push_back({ i, ex });
	}

	if (n != 1) buf.push_back({ n, 1 });

	return buf;
}

bool isInField(pairll next, ll row, ll col)
{
	return (0 <= next.second && next.second < col) && (0 <= next.first && next.first < row);
}

//逆元((1÷b) mod p、bを掛けるとmod pで1となる数)を求める
ll modinv(ll a, ll m)
{
	ll b = m, u = 1, v = 0;

	while (b)
	{
		ll t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}

	u %= m;

	if (u < 0)
		u += m;

	return u;
}

ll Combination(ll n, ll r)
{
	ll num = 1;

	for (ll i = 1; i <= r; i++)
	{
		num = num * (n - i + 1) / i;
		num %= mod;
	}

	return num;
}

int main() {
	ll n, m, l, ans = 0;
	string s = "No";
	bool flag = false;

	cin >> n;

	vecll ans2 = {6,10,15};

	ll six = 12, ten = 20,fif=30;

	while (ans2.size() < n)
	{
		if (six <= ten && six <= fif)
		{
			ans2.push_back(six);
			six += 6;
		}
		else if(ten <= six && ten <= fif)
		{
			ans2.push_back(ten);
			ten += 10;
		}
		else
		{
			ans2.push_back(fif);
			fif += 15;
		}

		sortLower(ans2);

		if (ans2[ans2.size() - 1] == ans2[ans2.size() - 2])
			ans2.pop_back();
	}

	sortLower(ans2);

	forll(i,0,ans2.size())
		out_(ans2[i]);
}