n = gets.to_i

d = Array.new(1001){Array.new(1001){0}}
n.times{|i|
  x1,y1,x2,y2 = gets.split.map(&:to_i)
  d[x1][y1] += 1
  d[x1][y2] -= 1
  d[x2][y1] -= 1
  d[x2][y2] += 1
}

max = d[0][0]
1000.times{|i|
  d[0][i+1] += d[0][i]
  max = d[0][i+1] if max < d[0][i+1]
  d[i+1][0] += d[i][0]
  max = d[i+1][0] if max < d[i+1][0]
}
1000.times{|i|
  1000.times{|j|
    d[i+1][j+1] += d[i][j+1]
    d[i+1][j+1] += d[i+1][j]
    d[i+1][j+1] -= d[i][j]
    max = d[i+1][j+1] if max < d[i+1][j+1]
  }
}

p max