N = gets.to_i
pos = readlines.map {|a| a.split.map(&:to_i) }
if pos.size == 1
  puts 1
else
  pq = pos.each_cons(2).map {|a,b| [b[0] - a[0], b[1] - a[1]] }
           .group_by(&:itself).delete_if {|k,v| k[0] == 0 || k[1] == 0 }
  if pq.empty?
    puts N
  else
    p,q = pq.max_by {|k,v| v.size }[0]
    puts pos.each_cons(2).count {|a,b| b[0]-p != a[0] || b[1]-q != a[1] } + 1
  end
end
