package main

import (
	"bufio"
	"os"
	"strconv"
	"container/heap"
	"fmt"
)

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

type Tuple struct {
	value int
	index int
}
// An Item is something we manage in a priority queue.
type Item struct {
	data     Tuple // The value of the item; arbitrary.
	priority int   // The priority of the item in the queue.
		       // The index is needed by update and is maintained by the heap.Interface methods.
	index    int   // The index of the item in the heap.
}

// A PriorityQueue implements heap.Interface and holds Items.
type PriorityQueue []*Item

func (pq PriorityQueue) Len() int {
	return len(pq)
}

func (pq PriorityQueue) Less(i, j int) bool {
	// We want Pop to give us the highest, not lowest, priority so we use greater than here.
	return pq[i].priority > pq[j].priority
}

func (pq PriorityQueue) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *PriorityQueue) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Item)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *PriorityQueue) Pop() interface{} {
	old := *pq
	n := len(old)
	item := pq.Top()
	item.index = -1 // for safety
	*pq = old[0 : n - 1]
	return item
}
func (pq *PriorityQueue) Top() *Item {
	old := *pq
	n := len(old)
	if n == 0 {
		return nil
	}
	item := old[n - 1]
	return item
}

// update modifies the priority and value of an Item in the queue.
func (pq *PriorityQueue) update(item *Item, value Tuple, priority int) {
	item.data = value
	item.priority = priority
	heap.Fix(pq, item.index)
}

func main() {

	sc := NewScanner()
	W, H := sc.NextInt(), sc.NextInt()
	queue := make(PriorityQueue, W + H)

	for i := 0; i < W; i++ {
		v := sc.NextInt()
		queue[i] = &Item{Tuple{v, i}, -v, i}
	}
	for i := 0; i < H; i++ {
		v := sc.NextInt()
		queue[i + W] = &Item{Tuple{v, i + W}, -v, i + W}
	}
	heap.Init(&queue)

	ans := 0
	w := W + 1
	h := H + 1

	for len(queue) > 0 {
		x := heap.Pop(&queue).(*Item)
		if x.data.index >= W {
			ans += x.data.value * w
			h--
		} else {
			ans += x.data.value * h
			w--
		}
	}
	fmt.Println(ans)

}



Measured memory_bytes: 10624