import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No0048 { public static void main(String[] args){ try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){ long x = Long.parseLong(br.readLine()); long y = Long.parseLong(br.readLine()); long l = Long.parseLong(br.readLine()); long cnt = Math.abs(y) / l + Math.abs(x) / l; if(Math.abs(y) % l > 0) cnt++; if(Math.abs(x) % l > 0) cnt++; if(y >= 0){ if(x != 0) cnt ++; }else{ cnt += 2; } System.out.println(cnt); }catch(IOException e){ e.printStackTrace(); } } }