#include <bits/extc++.h>
#define endl '\n'
typedef long long ll;
#define int ll
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
void Main()
{
int a, b;
cin >> a >> b;
const vector v = {a, b};
const int n = v.size();
vector<int> tr(n << 2), tg(n << 2);
auto pu = [&](const int p) { tr[p] = tr[p << 1] + tr[p << 1 | 1]; };
auto at = [&](const int rt, const int l, const int r, const int x)
{
tg[rt] += x;
tr[rt] += (r - l + 1) * x;
};
auto pd = [&](const int rt, const int l, const int r)
{
if (tg[rt])
{
const int mid = (l + r) >> 1;
at(rt << 1, l, mid, tg[rt]);
at(rt << 1 | 1, mid + 1, r, tg[rt]);
tg[rt] = 0;
}
};
function<void(int, int, int)> bld = [&](const int rt, const int l, const int r)
{
if (l == r)
{
tr[rt] = v[l - 1];
return;
}
const int mid = (l + r) >> 1;
bld(rt << 1, l, mid);
bld(rt << 1 | 1, mid + 1, r);
pu(rt);
};
function<void(int, int, int, int, int, int)> upt =
[&](const int rt, const int l, const int r, const int s, const int t, const int x)
{
if (s <= l && r <= t)
{
at(rt, l, r, x);
return;
}
pd(rt, l, r);
const int mid = (l + r) >> 1;
if (s <= mid)
{
upt(rt << 1, l, mid, s, t, x);
}
if (t > mid)
{
upt(rt << 1 | 1, mid + 1, r, s, t, x);
}
pu(rt);
};
function<int(int, int, int, int, int)> query = [&](const int rt, const int l, const int r, const int s, const int t)
{
if (s <= l && r <= t)
{
return tr[rt];
}
pd(rt, l, r);
const int mid = (l + r) >> 1;
int res = 0;
if (s <= mid)
{
res += query(rt << 1, l, mid, s, t);
}
if (t > mid)
{
res += query(rt << 1 | 1, mid + 1, r, s, t);
}
return res;
};
bld(1, 1, n);
cout << query(1, 1, n, 1, n) << endl;
}
// #define CP_MULTI_TEST_CASES
signed main()
{
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int t = 1;
#ifdef CP_MULTI_TEST_CASES
cin >> t;
#endif
while (t--)
{
Main();
}
return cout << flush, fflush(stdout), 0;
}