X = int(input()) Y = int(input()) L = int(input()) goal = [X, Y] koudou = 0 if(Y > 0):#北 while(True): if(Y <= 0): break Y -= L koudou += 1 elif(Y < 0):#南 koudou += 1 while(True): if(Y >= 0): break Y += L koudou += 1 if(X > 0):#東 koudou += 1 while(True): if(X <= 0): break X -= L koudou += 1 elif(X < 0):#西 koudou += 1 while(True): if(X >= 0): break X += L koudou += 1 print(koudou)