N = gets.to_i
x = []
y = []
N.times do |i|
  x[i], y[i] = gets.split.map(&:to_i)
end

xc = Hash.new(0)
yc = Hash.new(0)

x.sort!
y.sort!

0.upto(N-2) do |i|
  xc[x[i+1] - x[i]] += 1
  yc[y[i+1] - y[i]] += 1
end

puts [xc.size, yc.size].max