#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, start, n) for (ll i = (ll)(start); i < (ll)(n); ++i)
static const ll INFTY = 1L << 62L;
ll solver(ll n, ll k)
{
    ll a1, a2, b1, b2, c1, c2, d1, d2, p, q, ans = 0;
    for (p = 2; p <= 2 * n - k; ++p)
    {
        q = p + k;
        b1 = min(n, p - 1);
        a1 = p - b1;
        d1 = min(n, q - 1);
        c1 = q - d1;
        ans += (b1 - a1 + 1) * (d1 - c1 + 1);
    }
    return ans;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, k;
    cin >> n >> k;
    cout << solver(n, abs(k)) << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
  ll N,K;
  cin>>N>>K;
  for(int i=0;i<K;i++){
    if(N%200==0)
      N/=200;
    else{
      N=N*1000+200;
    }
  }
  cout<<N;
}

