
#include <iostream>
#include <climits>
#include <map>
#include <vector>
using namespace std;

int N;
pair<int, int>* arr;
int ans = 0;
void input(){
    cin >> N;
    arr = new pair<int, int>[N];

    for(int i = 0; i < N; i++){
        cin >> arr[i].first >> arr[i].second;
    }

}
void solve(){
    map<int,int> withSameX;
    map<int,int> withSameY;

    for(int i = 0; i < N - 1; i++){
        for(int j = i + 1; j < N; j ++){
            if(arr[i].first == arr[j].first){
                    if(withSameX.count(arr[i].first)){
                        withSameX[arr[i].first] += abs((arr[i].first - arr[j].first) + (arr[i].second - arr[j].second));
                    }
                    else{
                        withSameX[arr[i].first] = abs((arr[i].first - arr[j].first) + (arr[i].second - arr[j].second));
                    }
            }
            else if(arr[i].second == arr[j].second){
                    if(withSameY.count(arr[i].second)){
                        withSameY[arr[i].second] += abs((arr[i].first - arr[j].first) + (arr[i].second - arr[j].second));
                    }
                    else{
                        withSameY[arr[i].second] = abs((arr[i].first - arr[j].first) + (arr[i].second - arr[j].second));
                    }
            }
        }
    }
    for(auto entry : withSameX){
        if(entry.second > ans){
            ans = entry.second;
        }
    }
    for(auto entry : withSameY){
        if(entry.second > ans){
            ans = entry.second;
        }
    }
}

void output(){
    cout << ans << endl;
}

int main()
{
    input();
    solve();
    output();
    return 0;
}
