/*	_____________________
	|Author : canhnam357|
	|___________________|
*/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <string> vs;
typedef vector <vector <int>> vvi;
typedef vector <vll> vvll;
typedef map<int, int> mi;
typedef map<string, int> ms;
typedef map<char, int> mc;
typedef map <int, bool> mb;
typedef map<ll, ll> mll;
typedef unordered_map<int, int> umi;
typedef unordered_map<string, int> ums;
typedef unordered_map<char, int> umc;
typedef unordered_map <int, bool> umb;
typedef unordered_map<ll, ll> umll;
typedef vector <ld> vld;
typedef vector <bool> vb;
typedef pair <int, int> pii;
typedef pair<ll, ll> pll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
int CASE = 1;
const int mxn = 4e3 + 1;
const ll INF = 1e10;
#define FOR(i,N) for(ll i = 0 ; i < N;i++)
#define eFOR(i,a,b) for(ll i = a; i <=b;i++)
#define dFOR(i,N) for(ll i = N - 1; i>=0;i--)
#define edFOR(i,b,a) for(ll i = b ; i >=a;i--)
#define all(x) x.begin(),x.end()
#define SORT(x) sort(all(x))
#define RSORT(x) sort(x.rbegin(),x.rend())
#define UNQ(x)  unique(all(x))
#define mine(x) min_element(all(x))
#define maxe(x) max_element(all(x))
#define lb(v, x) lower_bound(all(v) , x)
#define ub(v , x) upper_bound(all(v) , x)
#define pb push_back
#define PI 3.141592653589793
#define FIX cout << fixed << setprecision(15)
#define g(i , a) get<i>(a)
const ll mod = 2e5;
int a[1000000];
bool prime(ll n)
{
	if (n <= 1)
		return false;
	eFOR(i, 2, sqrt(n))
		if (!(n % i))
			return false;
	return true;
}
ll __gcd(ll a, ll b)
{
	return !b ? a : __gcd(b, a % b);
}
bool cpx(pair<pii, pii> a, pair<pii, pii> b)
{
	return a.first.first < b.first.first;
}
bool cpy(pair<pii, pii> a, pair<pii, pii> b)
{
	return a.second.first < b.second.first;
}
void solve()
{
	int n;
	cin >> n;
	vector <pair<pii, pii>> v;
	vi vx, vy;
	vb ok(n, false);
	FOR(i, n)
	{
		int x, y;
		cin >> x >> y;
		v.push_back(make_pair(make_pair(x, i), make_pair(y, i)));
	}
	sort(all(v), cpx);
	set <pair <pii, pii>> s;
	s.insert(v[0]);
	s.insert(v[1]);
	s.insert(v[n - 2]);
	s.insert(v[n - 1]);
	sort(all(v), cpy);
	s.insert(v[0]);
	s.insert(v[1]);
	s.insert(v[n - 2]);
	s.insert(v[n - 1]);
	vector <pair<pii, pii>> vec(all(s));
	vi ans;
	for (int i = 0; i < vec.size() - 1; i++)
	{
		for (int j = i + 1; j < vec.size(); j++)
		{
			ans.push_back(max(abs(vec[i].first.first - vec[j].first.first), abs(vec[i].second.first - vec[j].second.first)));
		}
	}
	RSORT(ans);
	cout << ans[1];
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int T = 1;
	while (T--)
	{
		solve();
	}
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

typedef long long int lld;
#define all(m) m.begin(),m.end()
#define sz(m) lld(m.size())
#define pb push_back
#define mod 1000000007
#define st first
#define nd second
#define endl "\n"

#ifdef LOCAL
	#define debug(...) debug_out(#__VA_ARGS__, __VA_ARGS__)
	#define debug2(v,a,b) debug2_out(#v,v,a,b)
#else
	#define debug(...) 
	#define debug2(v,a,b) 
#endif

const int N=1e6+100;
void swagWaalaFunction()
{
	lld l,r,ans=0;
	cin>>l>>r;

	vector<lld> nfac(N);
	// Counts number of factors
	// stores -ve value if it is of form a1^x1 * a2^x2 ...., where a1,a2 are primes and some xi%2==0
	// Used to calculate mobius

	for(lld i=2;i<=r;i++)
	{
		if(nfac[i])
			continue;
		for(lld j=i;j<=r;j+=i)
			nfac[j]++;
		for(lld j=i*i;j<=r;j+=i*i)
			nfac[j]=-1e18;
	}

	// MOBIOUS MAGICCCC !!!
	for(lld i=2;i<=r;i++)
	{
		if(nfac[i]<0)
			continue;

		lld cnt=r/i-(l-1)/i;
		lld pairs=cnt*(cnt-1)/2;
		if(nfac[i]%2)
			ans+=pairs;
		else
			ans-=pairs;
	}

	// Remove multiples
	for(lld i=max(2LL,l);i<=r;i++)
		ans-=(r/i-1);

	ans*=2; // x,y and y,x are different
	cout<<ans<<endl;
}

int main()
{
	ios_base::sync_with_stdio(0); 
	cin.tie(NULL); 
	cout.tie(NULL);

	lld tc=1;
	//cin>>tc;

	for(int i=0;i<tc;i++)
	{
		// cout<<"Case #"<<i+1<<": ";
		swagWaalaFunction();
	}
	return 0;
}