#include #define LL long long #define ULL unsigned long long #define REP(i,n) for(int i=0; i<(n); i++) #define REP2(i,x,n) for(int i=x; i<(n); i++) using namespace std; int main (){ cin.tie(0); ios::sync_with_stdio(false); int L, K; cin >> L >> K; cout << ( L % ( K * 2 ) == 0 ? ( L - K * 2 ) / 2 : ( L - ( L % ( K * 2 ))) / 2 ) << endl; return 0; }