#include <iostream>
#include <algorithm>
using namespace std;

typedef long long ll;
ll a[200010];

int main()
{
    int n, m, sum;
    cin >> n >> m;
    sum = n + m + 1;
    int neg = 0; //负数个数
    for (int i = 1; i <= sum; i++)
    {
        cin >> a[i];
        if (a[i] < 0)
            neg++;
    }
    sort(a + 1, a + 1 + sum);
    ll ans = 0;
    if (m == 0)
    { //若没有负号
        for (int i = 1; i <= sum; i++)
            ans += a[i];
    }
    else
    {
        if (neg == 0)
        { //若没有负数
            ans -= a[1];
            for (int i = 2; i <= sum; i++)
                ans += abs(a[i]);
        }
        else
        {
            if (neg == sum)
            { //若全为负数
                for (int i = 1; i < sum; i++)
                    ans += abs(a[i]);
                ans += a[sum];
            }
            else
            {
                for (int i = 1; i <= sum; i++)
                    ans += abs(a[i]);
            }
        }
    }
    cout << ans;
    return 0;
}
