object Main extends App {
  import scala.io.StdIn._

  val Array(n, m) = readLine.trim.split(' ').map(_.toInt)
  val a = readLine.trim.split(' ').map(_.toLong).sum
  val b = readLine.trim.split(' ').map(_.toLong).sum
  println(a * b)
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline
    def let[A](func: T ⇒ A): A = func(value)
  }
}
