#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

#define int long long

using namespace std;

int q = 0;

int solve(const vector<pair<int, int>>& left, const vector<pair<int, int>>& right) {
	vector<vector<int>> a;
	for (int i = 0; i < left.size(); i++) {
		a.push_back({left[i].first, left[i].second, 0});
	}
	for (int i = 0; i < right.size(); i++) {
		a.push_back({right[i].first, right[i].second, 1});
	}
	sort(a.begin(), a.end());
	int mxl = -1;
	for (int i = 0; i < a.size(); i++) {
		if (a[i][2] == 0) mxl = max(mxl, a[i][1]);
		if (a[i][2] == 1 && mxl > a[i][0]) {
			q = max(q, 2 * min(mxl, a[i][1]) - 2 * a[i][0]);
		}
	}
	return q;
}

int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n;
	int ans = 0;
	cin >> n;
	vector<pair<int, int>> left, right;
	vector<int> u(n), v(n);
	for (int i = 0; i < n; i++) cin >> u[i];
	for (int j = 0; j < n; j++) cin >> v[j];

	for (int i = 0; i < n; i++) {
		int x = u[i];
		int y = v[i];
		ans += abs(x - y);
		if (x < y) left.push_back({x, y});
		else right.push_back({y, x});
	}
	sort(left.begin(), left.end());
	sort(right.begin(), right.end());
	solve(left, right);
	solve(right, left);
	cout << ans - q;
	return 0;
}