#include int main() { int a,b,c; scanf("%d %d\n",&a,&b); a/=2; while(a>b){ a-=b; c+=b; } printf("%d\n",c); return 0; }