#include <queue>
#include <functional>
#include <set>
#include <cassert>
#include <iomanip>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
#include <map>
#include <iostream>
using namespace std;

int lis(vector<int> &v) {
    int n = v.size();
    int dp[n+1];
    const int INF = 1<<30;
    fill(dp, dp+n+1, INF);
    dp[0] = -1;
    for (int i = 0; i < n; i++) {
        int *p = upper_bound(dp, dp+n+1, v[i]);
        *p = v[i];
    }
    return lower_bound(dp, dp+n+1, INF) - dp - 1;
}

const int R = 0, U = 1, L = 2, D = 3;
inline int opp(int d) { return d^2; }
inline int turnleft(int d) { return (d + 1) % 4; }

double solve_dp(int n, int x1, int y1, int x2, int y2, const pair<int, int> *ps) {
    set<pair<int, int> > fs;
    for (int i = 0; i < n; i++) fs.insert(ps[i]);
    const int l = min(x1, x2), r = max(x1, x2), b = min(y1, y2), t = max(y1, y2);
    const int m = (r-l+1) * (t-b+1) * 4;
    function<int(int, int, int)> get_node = [&](int x, int y, int d) {
        return ((x - l) * (t - b + 1) + y - b) * 4 + d;
    };
    vector<vector<pair<int, double> > > adj(m);
    for (int x = l; x <= r; x++)
        for (int y = b; y <= t; y++) {
            if (x < r) {
                // right
                const int u = get_node(x, y, R), v = get_node(x+1, y, L);
                double d = 100;
                if (fs.find({x, y}) != fs.end() || fs.find({x+1, y}) != fs.end())
                    d -= 10;
                adj[u].push_back({v, d});
                adj[v].push_back({u, d});
            }
            if (y < t) {
                // up
                const int u = get_node(x, y, U), v = get_node(x, y+1, D);
                double d = 100;
                if (fs.find({x, y}) != fs.end() || fs.find({x, y+1}) != fs.end())
                    d -= 10;
                adj[u].push_back({v, d});
                adj[v].push_back({u, d});
            }
            // along circle
            const double f = (fs.find({x, y}) == fs.end()) ? 0 : M_PI * 5;
            for (int d = 0; d < 4; d++) {
                const int u = get_node(x, y, d),
                    v = get_node(x, y, turnleft(d));
                adj[u].push_back({v, f});
                adj[v].push_back({u, f});
            }
        }

    // for (int i = 0; i < m; i++)
    //     for (auto [j, d] : adj[i]) cerr << i << " " << j << " " << d << endl;
    priority_queue<pair<double, int> > pq;
    vector<double> dist(m, 1e100);
    for (int d = 0; d < 4; d++) {
        const int v = get_node(x1, y1, d);
        dist[v] = 0;
        pq.push({-0, v});
    }
    while (!pq.empty()) {
        auto [d, v] = pq.top();
        d = -d;
        pq.pop();
        // cerr << v << " " << d << endl;
        if (dist[v] < d) continue;
        for (auto [u, c] : adj[v]) {
            if (dist[u] > d + c) {
                dist[u] = d + c;
                pq.push({-d-c, u});
            }
        }
    }
    double ans = 1e100;
    for (int d = 0; d < 4; d++)
        ans = min(ans, dist[get_node(x2, y2, d)]);
    return ans;
};

double solve(int n, int x1, int y1, int x2, int y2, pair<int, int> *ps) {
    int gx = x2 - x1, gy = y2 - y1;
    bool rx = gx < 0, ry = gy < 0;
    gx = abs(gx); gy = abs(gy);
    vector<int> v;
    if (rx) sort(ps, ps+n, greater<pair<int, int> >());
    else sort(ps, ps+n);
    for (int i = 0; i < n; i++) {
        int &x = ps[i].first, &y = ps[i].second;
        x -= x1; y -= y1;
        if (rx) x = -x;
        if (ry) y = -y;
        if (0 <= x && x <= gx && 0 <= y && y <= gy) v.push_back(y);
    }

    int len = lis(v);
    double ans = (gx + gy) * 100.0 - 10 * len * (2 - M_PI / 2);
    if (len == 1 + min(gx, gy)) ans += 5 * M_PI;
    return ans;
}

int main() {
    int x1, y1, gx, gy, n; cin >> x1 >> y1 >> gx >> gy >> n;
    pair<int, int> ps[n];
    for (int i = 0; i < n; i++)
        cin >> ps[i].first >> ps[i].second;
    // double ans2 = solve_dp(n, x1, y1, gx, gy, ps);
    double ans = solve(n, x1, y1, gx, gy, ps);
    cout << setprecision(18) << ans << endl;

    // if (abs(ans / ans2 - 1) > 1e-9)
    //     cout << "WA: ans = " << ans << "; ans2 = " << ans2 << endl;
}



Measured memory_bytes: 5972