#include int main(void) { int X, Y, L; int dir = 0; int count = 0; scanf("%d %d %d", &X, &Y, &L); if(L < X && L < Y){ if(X == 0 && Y == 0) count = 0; else if(X == 0 && Y > 0){ count += Y/L; } else if(X == 0 && Y < 0){ count = -Y/L + 2; } else if(Y == 0){ count += X/L + 1; } else if(X > 0 && Y > 0){ count += X/L + Y/L + 2; } else if(X > 0 && Y < 0){ count += X/L - Y/L + 2; } else if(X < 0 && Y > 0){ count += - X/L + Y/L + 2; } else if(X < 0 && Y < 0) { count += - X/L - Y/L + 2; } } else if(L < X && L > Y){ if(X == 0 && Y == 0) count = 0; else if(X == 0 && Y > 0){ count += 1; } else if(X == 0 && Y < 0){ count = 1 + 2; } else if(Y == 0){ count += X/L + 1; } else if(X > 0){ count += X/L + 1 + 2; } else if(X < 0 && Y > 0){ count += - X/L + 1 + 2; } } else if(L > X && L < Y){ if(X == 0 && Y == 0) count = 0; else if(X == 0 && Y > 0){ count += Y/L; } else if(X == 0 && Y < 0){ count = -Y/L + 2; } else if(Y == 0){ count += 1 + 1; } else if(X > 0 && Y > 0){ count += 1 + Y/L + 2; } else if(X > 0 && Y < 0){ count += 1 - Y/L + 2; } else if(X < 0 && Y > 0){ count += 1 + Y/L + 2; } else if(X < 0 && Y < 0) { count += 1 - Y/L + 2; } } else if(L > X && L > Y){ if(X == 0 && Y == 0) count = 0; else if(X == 0 && Y > 0){ count += 1; } else if(X == 0 && Y < 0){ count = 1 + 2; } else if(Y == 0){ count += 1 + 1; } else if(X > 0 && Y > 0){ count += 1 + 1 + 2; } else if(X > 0 && Y < 0){ count += 1 + 1 + 2; } else if(X < 0 && Y > 0){ count += 1 + 1 + 2; } else if(X < 0 && Y < 0) { count += 1 + 1 + 2; } } printf("%d\n", count); return 0; }