#include #include #include #include #include #include #include using namespace std; typedef long long ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int a,b,c,d,e,f; cin >> a >> b >> c >> d >> e >> f; cout << abs(c-e)+abs(d-f) << endl; }