n,m=map(int,input().split()) if n<=m:print(1) elif n%m==0:print(n//m) elif n%m>2:print(n//m+1) else:print(-1)