#import <stdio.h>
#import <stdlib.h>
#import <limits.h>
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))

long CEIL(double x) {
    long i = (long)x;
    return i + (((x != i) && (x > 0)) ? 1 : 0);
}

int main(int argc, const char * argv[]) {
    long N, K;
    scanf("%ld %ld", &N, &K);
    
    long n;
    long i = 0;
    while (scanf("%ld", &n) != EOF) {
        if (n==1) {
            break;
        }
        i++;
    }
    
    long JMIN = MAX(0,-N+K+i);
    long JMAX = MIN(K-1,i);
    long min = LONG_MAX;
    for(long j=JMIN;j<=JMAX;j++){
        min = MIN(min, 1 + CEIL((double)(i-j)/(K-1)) + CEIL((double)(N-i-K+j)/(K-1)) );
    }
    
    printf("%ld", min);
    
    return 0;
}
