#include <bits/stdc++.h>
using namespace std; 
int main(){
//  freopen("test.in","r",stdin);
//  freopen("test.out","w",stdout);
	int a,b;
	cin>>a>>b;
	if(a<=b*2) cout<<0;
	else cout<<a-b*2;
    return 0;
}
