#include <bits/stdc++.h>
using namespace std;

#define int long long
#define forn(i,a,n) for (int i=a; i<n; i++)

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	
	int b,c;
  	cin>>b>>c;
  	if (b!=0 && c==1){
      	cout<<2<<endl;
      	return 0;
    }
  	int A,B,C,D;
  	if (c%2==1){
      	A=-b-c/2;
      	B=-b+c/2;
      	c--;
      	C=b-c/2;
      	D=b+c/2-1;
    }
  	else{
      	A=b-c/2;
      	B=b+c/2-1;
      	c--;
      	C=-b-c/2;
      	D=-b+c/2;
    }
  	//cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<endl;
  	cout<<(B-A+1)+(D-C+1)-max(0ll,min(B,D)-max(A,C)+1)<<endl;
	return 0;
}
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <bits/stdc++.h>
using namespace std;

#define lson 2*i  
#define rson 2*i+1  
#define LS l,mid,lson  
#define RS mid+1,r,rson  
#define UP(i,x,y) for(i=x;i<=y;i++)  
#define DOWN(i,x,y) for(i=x;i>=y;i--)  
#define MEM(a,x) memset(a,x,sizeof(a))  
#define W(a) while(a)  
#define gcd(a,b) __gcd(a,b)  
#define ll long long  
#define MAX 1000005  
#define MOD 1000000007  
#define INF 0x3f3f3f3f  
#define EXP 1e-8  
#define lowbit(x) (x&-x)  
ll gcd(ll p,ll q){return q==0?p:gcd(q,p%q);}
ll qpow(ll p,ll q){ll f=1;while(q){if(q&1)f=f*p;p=p*p;q>>=1;}return f;}

int main () {
    ll n, k; cin >> n >> k;
    while (k--) {
        if (n % 200) {
            n *= 1000; n += 200;
        } else 
            n /= 200;
    }
    cout << n << endl;
    return 0;
}