#include using namespace std; #define rep(i, n) for(int i = 0; i < n; i++) typedef long long int64; int main() { int64 N, K; cin >> N >> K; if(K >= N) { cout << 0 << endl; } else if(K == 1) { cout << (N + 1) / 2 << endl; } else { int64 call = N / (K + 1); N -= call * (K + 1); if(N >= K) cout << call << endl; else cout << call + 1 << endl; } }