#include using namespace std; int main() { int r; cin >> r; cin >> r; int a, b, c, d; cin >> a >> b >> c >> d; cout << (abs(a - c) + abs(b - d)) << endl; }