n = gets.to_i
balls = []

gapX = []
gapY = []

gapsX = []
gapsY = []

n.times do |i|
  balls << gets.split.map(&:to_i)
  if i > 0
    tmp1 = balls[i][0] - balls[i - 1][0]
    tmp2 = balls[i][1] - balls[i - 1][1]
    gapX << tmp1
    gapsX << tmp1
    gapY << tmp2
    gapsY << tmp2
  end
end

gapX.sort!
gapY.sort!

maxX = 0
maxY = 0

maxXd = 0
maxYd = 0

cntX = 0
cntY = 0

lastX = 0
lastY = 0

(n - 1).times do |i|

  if gapX[i] != lastX || i == n - 2
    if lastX == gapX[i]
      cntX += 1
    end
    if maxX < cntX
      maxX  = cntX
      maxXd = lastX
    end
    lastX = gapX[i]
  end

  if gapY[i] != lastY || i == n - 2
    if lastY == gapY[i]
      cntY += 1
    end
    if maxY < cntY
      maxY  = cntY
      maxYd = lastY
    end
    lastY = gapY[i]
  end

end

ans = 1

(n - 1).times do |i|
  unless gapsX[i] == maxXd && gapsY[i] == maxYd
    ans += 1
  end
end

puts ans
