#include using namespace std; constexpr int mod = 1000000007; int main() { int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; cout << abs(c - d) + abs(e - f); }