#include int main() { int n,m; scanf("%d %d", &n,&m); if (n%2 != 0) { printf("-1\n"); } else if(n%m==0) { printf("%d\n",n/m); } else { printf("%d\n", n/m + 1); } return 0; }