#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <random>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef vector<vll> vvll;
typedef std::vector<std::pair<int, int> > vpi;
typedef vector<vpi> vvpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair
const ld PI = acos(ld(-1));
const ll INF = 1e18;
class stree {
public:
    vll t;
    int s;
    void build (vll & a, int v, int tl, int tr) {
        if(v==1) {
            t.resize(a.size() * 4);
            s = a.size();
        }
        if (tl == tr)
            t[v] = a[tl];
        else {
            int tm = (tl + tr) / 2;
            build (a, v*2, tl, tm);
            build (a, v*2+1, tm+1, tr);
            t[v] = max(t[v*2], t[v*2+1]);
        }
    }
    
    void set (int v, int tl, int tr, int pos, ll val) {
        if (pos == tl && tr == pos) {
            t[v] = val;
        }
        else {
            int tm = (tl + tr) / 2;
            if(pos<=tm) set(v*2, tl, tm, pos, val);
            else set(v*2+1, tm+1, tr, pos, val);
            t[v] = max(t[v*2], t[v*2+1]);
        }
    }
    
    ll get (int v, int tl, int tr, int l, int r) {
        if(l>r) return -INF;
        if (tl == l && tr == r)
            return t[v];
        int tm = (tl + tr) / 2;
        return max(get (v*2, tl, tm, l, min(r,tm)), get(v*2+1, tm+1, tr, max(l,tm+1), r));
    }
};

int main()
{
//#ifndef ONLINE_JUDGE
//    freopen("input.txt", "rt", stdin);
//    freopen("output.txt", "wt", stdout);
//#endif
    int x1,y1,x2,y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    if(x1 > x2) {
        swap(x1,x2);
        swap(y1,y2);
    }
    int n;
    scanf("%d", &n);
    vi x(n), y(n);
    
    forn(i,0,n) {
        scanf("%d %d", &x[i], &y[i]);
    }
    int A = 99999999;
    if(y1 > y2) {
        y1=A-y1;
        y2=A-y2;
        forn(i,0,n) y[i] = A-y[i];
    }
    // x1<=x2 y1<=y2
    ld ans = 10*(x2-x1+y2-y1);
    if(x1==x2) {
        forn(i,0,n) {
            if(x[i] == x1 && y[i] > y1 && y[i] < y2) ans += PI - 2;
        }
        printf("%.15lf", (double) ans*10);
        return 0;
    }
    else if(y1==y2) {
        forn(i,0,n) {
            if(y[i] == y1 && x[i] > x1 && x[i] < x2) ans += PI - 2;
        }
        printf("%.15lf", (double) ans*10);
        return 0;
    }
    set<int> vx;
    vx.insert(x1);
    vx.insert(x2);
    vpi pt;
    forn(i,0,n) {
        if(x1<=x[i] && x[i] <= x2 && y1<=y[i] && y[i]<=y2) {
            vx.insert(x[i]);
            pt.pb(mp(y[i], x[i]));
        }
    }
    vi vix;
    for(auto x : vx) vix.pb(x);
    int k = vix.size();
    map<int, int> to;
    forn(i,0,k) to[vix[i]] = i;
    vll def(k,0);
    stree st;
    st.build(def, 1, 0, k-1);
    sort(all(pt));
    for(auto point : pt) {
        int x = point.second;
        int y = point.first;
        int xp = to[x];
        st.set(1, 0, k-1, xp, st.get(1, 0, k-1, 0, xp) + 1);
    }
    int res = st.get(1, 0, k-1, 0, k-1);
    if(res<1+min(x2-x1, y2-y1)) {
        ans += res*(PI/2-2);
    }
    else {
        ans += (res-1)*(PI/2-2) + PI-2;
    }
    printf("%.15lf", (double) ans*10);
    
}



Measured memory_bytes: 30704