def add(a, w, d)
  while a <= d.size - 1
    d[a] += w
    a += a & -a
  end
end

def sum(i, d)
  ret = 0
  x = i
  while x > 0
    ret += d[x]
    x -= x & -x
  end
  return ret
end

n = gets.to_i

r = []
x = {}
y = {}
n.times{|i|
  r[i] = gets.split.map(&:to_i)
  x[r[i][0]]=1
  y[r[i][1]]=1
  x[r[i][2]]=1
  y[r[i][3]]=1
}

sx = x.keys.sort
xi = {}
sx.each_with_index{|v, i|
  xi[v] = i
}
sy = y.keys.sort
yi = {}
sy.each_with_index{|v, i|
  yi[v] = i
}

d = Array.new(sx.size){Array.new(sy.size+1){0}}

n.times{|i|
  xi[r[i][0]].upto(xi[r[i][2]]-1){|j|
    add(yi[r[i][1]]+1,  1, d[j])
    add(yi[r[i][3]]+1, -1, d[j])
  }
}

max = 0
(sx.size-1).times{|i|
  (sy.size-1).times{|j|
    m = sum(j+1, d[i])
    max = m if m > max
  }
}
p max