#import <Foundation/Foundation.h>
#include <stdio.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        int bw,bh,bd;
        scanf("%d %d", &bw, &bh);
        NSInteger w = bw;
        NSInteger h = bh;
        NSMutableArray *pq = [NSMutableArray array];
        
        for (int i=0;i<w+h;i++){
            scanf("%d", &bd);
            NSMutableDictionary *dic = [NSMutableDictionary dictionary];
            [dic setObject:[NSNumber numberWithInteger:bd] forKey:@"len"];
            
            if (i<w) {
                [dic setObject:[NSNumber numberWithInteger:0] forKey:@"dir"];
            }
            else{
                [dic setObject:[NSNumber numberWithInteger:1] forKey:@"dir"];
            }
            [pq addObject:dic];
        }

        NSSortDescriptor *sortconf = [[NSSortDescriptor alloc] initWithKey:@"len" ascending:YES];
        pq = (NSMutableArray*)[pq sortedArrayUsingDescriptors:@[sortconf]];
        w++;h++;
        
        NSInteger ans = 0;
        for (NSMutableDictionary* obj in pq) {
            NSInteger l = [[obj objectForKey:@"len"] integerValue];
            if ([[obj objectForKey:@"dir"] integerValue]) {
                ans += l * w;
                h--;
            }
            else {
                ans += l * h;
                w--;
            }
        }
        printf("%lld¥n",(long long)ans);
    }
    return 0;
}
