#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> pii;

inline bool valid(int x, int n) {
    return 0 <= x && x < n;
}

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};

template <typename T>
inline T pop(queue<T>& q) {
    T front = q.front();
    q.pop();
    return front;
}

template <typename T>
inline T gcd(T a, T b) {
    for (; b; a %= b, swap(a, b));
    return a; 
}

#define x first
#define y second

pii operator-(pii& a, pii& b) {
    return {a.x-b.x, a.y-b.y};
}

inline int ccw(pii& a, pii& b, pii& c) {
    pii A = b - a;
    pii B = c - b;
    
    ll cross = (ll)A.x*B.y - (ll)A.y*B.x;
    if (cross > 0) return 1;
    if (cross < 0) return -1;
    return 0;
}

inline ll dist(pii& a, pii& b) {
    ll dx = b.x - a.x;
    ll dy = b.y - a.y;
    return abs(dx) + abs(dy);
}

inline long double norm(pii& p) {
    return sqrt((ll)p.x*p.x + (ll)p.y*p.y);
}

inline ll dot_prod(pii& a, pii& b) {
    return {(ll)a.x*b.x + (ll)a.y*b.y};
}

inline long double cosine(pii& a, pii& b) {
    return dot_prod(a, b) / norm(a) / norm(b);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    
    int N; cin >> N;
    pii p[200005];
    for (int i = 0; i < N; i++) cin >> p[i].x >> p[i].y;
    
    sort(p, p+N);
    vector<pii> up; up.reserve(N);
    for (int i = 0; i < N; i++) {
        up.push_back(p[i]);
        while (up.size() >= 3) {
            if (ccw(up[up.size()-3], up[up.size()-2], up[up.size()-1]) == -1) break;
            up.erase(up.end()-2);
        }
    }
    
    reverse(p, p+N);
    vector<pii> down; down.reserve(N);
    for (int i = 0; i < N; i++) {
        down.push_back(p[i]);
        while (down.size() >= 3) {
            if (ccw(down[down.size()-3], down[down.size()-2], down[down.size()-1]) == -1) break;
            down.erase(down.end()-2);
        }
    }
    
    vector<pii> cvxh; cvxh.reserve(N);
    for (int i = 0; i < up.size()-1; i++) cvxh.push_back(up[i]);
    for (int i = 0; i < down.size()-1; i++) cvxh.push_back(down[i]);
    
    pii lleg = {0, 1};
    pii rleg = {0, -1};
    int lidx = 0;
    int ridx = up.size()-1;
    
    int lrst = lidx;
    int rrst = ridx;
    ll Mdst = dist(cvxh[lrst], cvxh[rrst]);
    
    for (int i = 0; i < cvxh.size(); i++) {
        pii lside = cvxh[(lidx+1)%cvxh.size()] - cvxh[lidx];
        pii rside = cvxh[(ridx+1)%cvxh.size()] - cvxh[ridx];
        
        long double lcos = cosine(lleg, lside); 
        long double rcos = cosine(rleg, rside);
        
        //long double lcos = dot_prod(lleg, lside) * norm(rleg) * norm(rside);
        //long double rcos = dot_prod(rleg, rside) * norm(lleg) * norm(lside);
        
        if (lcos > rcos) {
            lleg = lside;
            rleg = {-lleg.x, -lleg.y};
            lidx++;
            lidx %= cvxh.size();
        }
        else if (rcos > lcos) {
            rleg = rside;
            lleg = {-rleg.x, -rleg.y};
            ridx++;
            ridx %= cvxh.size();
        }
        else {
            lleg = lside;
            rleg = rside;
            lidx++;
            lidx %= cvxh.size();
            ridx++;
            ridx %= cvxh.size();
        }
        
        if (Mdst < dist(cvxh[lidx], cvxh[ridx])) {
            lrst = lidx;
            rrst = ridx;
            Mdst = dist(cvxh[lrst], cvxh[rrst]);
        }
    }
    cout << Mdst;
}

Measured memory_bytes: 5180