d = list(map(int,input().split())) if d[0]/d[1] == 2: print(0) elif d[0]//(2*d[1]) == 0: print(d[0]/d[1]-1) else: print(int(d[0]/(d[1]*2)))