N = gets.to_i
M = 1000
imos = (M+1).times.map{[0] * (M+1)}
$<.map{|s|
  x1, y1, x2, y2 = s.split.map &:to_i
  imos[y1][x1] += 1
  imos[y1][x2] -= 1
  imos[y2][x1] -= 1
  imos[y2][x2] += 1
}
M.times{|y|
  sum = 0
  M.times{|x|
    imos[y][x] = sum += imos[y][x]
  }
}
M.times{|x|
  sum = 0
  M.times{|y|
    imos[y][x] = sum += imos[y][x]
  }
}

p imos.map{|s|s.max}.max