// #define DEBUGGING
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
template <typename T> using V = std::vector<T>;
template <typename T> using VV = V<V<T>>;
using ll = std::int64_t;
using ull = std::uint64_t;
using PLL = std::pair<ll, ll>;
using TLL = std::tuple<ll, ll, ll>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }
#define mv_rec make_v(init, tail...)
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, size_t s, Tail... tail) { return V<decltype(mv_rec)>(s, mv_rec); }
#undef mv_rec
using namespace std;
#ifdef DEBUGGING
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

const ll MAXL = 1e8;

template <typename T>
class SegmentTree {
public:
    ll size;
    vector<T> node;
    function<T(T, T)> comp;
    T identity_ele;  //comp(x, identity_ele) == x

    SegmentTree(const vector<T> &v, function<T(T, T)> comp, T identity_ele) 
        : comp(comp),
          identity_ele(identity_ele)
    {
        ll tmp = 1;
        while(tmp < v.size()) tmp = (tmp << 1);
        this->size = tmp;
        this->identity_ele = identity_ele;
        this->comp = comp;
        node = V<T>(2 * size - 1, identity_ele);
        for(ll i = 0; i < v.size(); i++) {
            node[i + size - 1] = v[i];
        }
        for(ll i = size - 2; 0 <= i; i--) {
            node[i] = comp(node[i * 2 + 1], node[i * 2 + 2]);
        }
    }

    void update(ll pos, T value) {
        pos += size - 1;
        node[pos] = value;
        while(pos > 0) {
            pos = (pos - 1) / 2;
            node[pos] = comp(node[2 * pos + 1], node[2 * pos + 2]);
        }
    }

    T query(ll a, ll b) {
        if(b <= a) return identity_ele;
        return sub_query(a, b, 0, 0, size);
    }

    T sub_query(ll a, ll b, ll k, ll l, ll r) {
        if(r <= a || b <= l) {
            return identity_ele;
        } else if(a <= l && r <= b) {
            return node[k];
        } else {
            T left = sub_query(a, b, k * 2 + 1, l, (l + r) / 2);
            T right = sub_query(a, b, k * 2 + 2, (l + r) / 2, r);
            return comp(left, right);
        }
    }
};

double solve() {
    ll x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    ll N;
    cin >> N;
    V<PLL> xy(N);
    for(auto &&ele : xy) {
        ll x, y;
        cin >> x >> y;
        ele = PLL(x, y);
    }

    if(x2 < x1) {
        swap(x1, x2);
        swap(y1, y2);
    }
    if(y2 < y1) {
        y1 = MAXL - y1;
        y2 = MAXL - y2;
        for(auto &&ele : xy) {
            ll x, y;
            tie(x, y) = ele;
            y = MAXL - y;
            ele = PLL(x, y);
        }
    }
    
    double dist = (x2 - x1) + (y2 - y1);
    dist *= 100;

    if(x1 == x2 || y1 == y2) {
        for(auto &&ele : xy) {
            ll x, y;
            tie(x, y) = ele;
            if(x1 <= x && x <= x2 &&
               y1 <= y && y <= y2) {
                dist -= 20;
                dist += 20 / 2 * M_PI;
                return dist;
            }
        }
        return dist;
    }

    V<ll> coors(2 * N + 5);
    {
        for(ll i = 0; i < N; i++) {
            coors[2 * i] = xy[i].first;
            coors[2 * i + 1] = xy[i].second;
        }
        coors[2 * N] = x1;
        coors[2 * N + 1] = x2;
        coors[2 * N + 2] = y1;
        coors[2 * N + 3] = y2;
        coors[2 * N + 4] = -1;
        sort(ALL(coors));
        auto ite = unique(ALL(coors));
        coors.erase(ite, coors.end());
        auto get_idx = [&](ll x) {
            return distance(coors.begin(),
                            lower_bound(ALL(coors), x));
        };
        x1 = get_idx(x1);
        y1 = get_idx(y1);
        x2 = get_idx(x2);
        y2 = get_idx(y2);
        for(auto &&ele : xy) {
            ll x, y;
            tie(x, y) = ele;
            ele = PLL(get_idx(x), get_idx(y));
        }
    }

    {
        auto cpy = move(xy);
        xy.clear();
        for(auto &&ele : cpy) {
            ll x, y;
            tie(x, y) = ele;
            if(!(x1 <= x && x <= x2 &&
                 y1 <= y && y <= y2)) continue;
            xy.push_back(ele);
        }
    }

    double d1 = 2 * 10;
    double d2 = 2 * 10 / 4 * M_PI;
    double diff = d1 - d2;
    const double inf = 5e15;
    double ans = inf;

    do {
        sort(ALL(xy));
        if(xy.empty()) break;
        if(xy.back().first != x2) break;
        ll cnt = 0;
        bool fin = false;
        for(ll i = (ll)xy.size() - 2; 0 <= i; i--) {
            ll a, b, c, d;
            tie(a, b) = xy[i + 1];
            tie(c, d) = xy[i];
            a = coors[a];
            b = coors[b];
            c = coors[c];
            d = coors[d];
            DEBUG(make_tuple(a, b, c, d));
            if(c + 1 == a && d < b) {
                cnt++;
            } else {
                break;
            }
            if(cnt + 1 == xy.size() && xy[0].first == x1) {
                cnt++;
                fin = true;
            }
        }
        chmin(ans, dist - diff * cnt + d2);
        DEBUG(make_tuple(ans, cnt));
        if(fin) return ans;
        if(xy.empty()) return ans;
    } while(false);

    do {
        sort(ALL(xy), [](PLL p, PLL q) { return p.second < q.second; });
        if(xy.empty()) break;
        if(xy.back().second != y2) break;
        ll cnt = 0;
        bool fin = false;
        for(ll i = (ll)xy.size() - 2; 0 <= i; i--) {
            ll a, b, c, d;
            tie(a, b) = xy[i + 1];
            tie(c, d) = xy[i];
            a = coors[a];
            b = coors[b];
            c = coors[c];
            d = coors[d];
            if(d + 1 == b && c < a) {
                cnt++;
            } else {
                break;
            }
            if(cnt + 1 == xy.size() && xy[0].second == y1) {
                cnt++;
                fin = true;
            }
        }
        chmin(ans, dist - diff * cnt + d2);
        DEBUG(make_tuple(ans, cnt));
        if(fin) return ans;
    } while(false);

    SegmentTree<ll> seg(V<ll>(2 * N + 10, 0), [](ll a, ll b) { return max(a, b); }, 0);
    sort(ALL(xy));
    for(auto &&ele : xy) {
        ll x, y;
        tie(x, y) = ele;
        if(!(x1 <= x && x <= x2 &&
             y1 <= y && y <= y2)) continue;
        ll val = seg.query(0, y);
        seg.update(y, val + 1);
    }

    chmin(ans, dist - seg.query(0, 2 * N + 10) * diff);
    return ans;
}

int main() {
    cout << solve() << endl;
    return 0;
}


Measured memory_bytes: 19892