object Main {
  def main(args: Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val list = List.fill(n)(sc.nextInt)
    sc.close()

    val calc = (0 until n).map(i => (i, list.take(i).sum - list.drop(i).sum))
    val result = calc.sortBy(_._2).find(_._2 >= 0)
    println(result.toList(0)._2)
  }
}