#include <bits/stdc++.h>
#include<stdlib.h>
using namespace std;

typedef long long int ll;
typedef long double ld;

#define rep(i,a,b) for(ll i=a;i<=b;++i)
#define rev(i,a,b) for(ll i=a;i>=b;i--)
#define pll pair<ll,ll>
#define vll vector<ll>
#define sll set<ll>
#define vpll vector<pll>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ln length()
#define M 1000000007
ll xs,ys,x2,y2,n;
vpll pts;
bool cmp1(pll p1,pll p2){
    if(p1.F != p2.F) return p1.F < p2.F;
    return p1.S<p2.S;
}
bool cmp2(pll p1,pll p2){
    if(p1.F != p2.F) return p1.F < p2.F;
    return p1.S>p2.S;
}
bool cmp3(pll p1,pll p2){
    if(p1.F != p2.F) return p1.F > p2.F;
    return p1.S<p2.S;
}
bool cmp4(pll p1,pll p2){
    if(p1.F != p2.F) return p1.F > p2.F;
    return p1.S>p2.S;
}


bool cmp5(pll p1,pll p2){
    if(p1.S != p2.S) return p1.S < p2.S;
    return p1.F<p2.F;
}
bool cmp6(pll p1,pll p2){
    if(p1.S != p2.S) return p1.S < p2.S;
    return p1.F>p2.F;
}
bool cmp7(pll p1,pll p2){
    if(p1.S != p2.S) return p1.S > p2.S;
    return p1.F<p2.F;
}
bool cmp8(pll p1,pll p2){
    if(p1.S != p2.S) return p1.S > p2.S;
    return p1.F>p2.F;
}

ll a[200005];
pll p[200005];
ll pos[200005],dp[200005],dp2[200005];

ll seg[1000001];


void update(ll idx,ll lo,ll hi,ll st,ll en,ll val){
    if(lo==st&&hi==en) {
        seg[idx]+=val;
        return;
    }

    ll mid=(lo+hi)/2;
    if(en<=mid) update(2*idx,lo,mid,st,en,val);
    else if(st>mid) update(2*idx+1,mid+1,hi,st,en,val);
    else{
        update(2*idx,lo,mid,st,mid,val);
        update(2*idx+1,mid+1,hi,mid+1,en,val);
    }
    seg[idx]=max(seg[2*idx],seg[2*idx+1]);
}
ll query(ll idx,ll lo,ll hi,ll st,ll en){
    if(lo==st&&hi==en) return seg[idx];

    ll mid=(lo+hi)/2;
    if(en<=mid) return query(2*idx,lo,mid,st,en);
    else if(st>mid) return query(2*idx+1,mid+1,hi,st,en);
    else return max(query(2*idx,lo,mid,st,mid),query(2*idx+1,mid+1,hi,mid+1,en));
}

const ld pi = 3.14159265358979323846;

int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    cout<<setiosflags(ios::fixed|ios::showpoint)<<setprecision(20);
    cin>>xs>>ys>>x2>>y2>>n;
    rep(i,1,n){
        ll x,y;cin>>x>>y;
        if(x < min(xs,x2) || x>max(xs,x2)) continue;
        if(y < min(ys,y2) || y>max(ys,y2)) continue;
        pts.pb(mp(x,y));
    }

    if(xs <= x2 && ys <= y2) sort(pts.begin(),pts.end(),cmp1);
    else if(xs <= x2 && ys > y2) sort(pts.begin(),pts.end(),cmp2);
    else if(xs > x2 && ys <= y2) sort(pts.begin(),pts.end(),cmp3);
    else sort(pts.begin(),pts.end(),cmp4);

    if(pts.empty()){
        cout<<abs(x2-xs)*100.0+abs(y2-ys)*100.0<<'\n';
        return 0;
    }
    n=pts.size();

    rep(i,1,n) a[i]=pts[i-1].S,p[i]=mp(a[i],i);
    sort(p+1,p+n+1);
    rep(i,1,n ) pos[p[i].S]=i;

    dp[1]=1;
    update(1,1,n,pos[1],pos[1],1);

    rep(i,2,n){
        if(ys<=y2) dp[i]=1+query(1,1,n,1,pos[i]);
        else dp[i]=1+query(1,1,n,pos[i],n);
        update(1,1,n,pos[i],pos[i],dp[i]);
    }

    rep(i,1,n) dp[i]=max(dp[i],dp[i-1]);

    if(ys <= y2 && xs <= x2) sort(pts.begin(),pts.end(),cmp5);
    else if(ys <= y2 && xs > x2) sort(pts.begin(),pts.end(),cmp6);
    else if(ys > y2 && xs <= x2) sort(pts.begin(),pts.end(),cmp7);
    else sort(pts.begin(),pts.end(),cmp8);


    rep(i,1,n) a[i]=pts[i-1].F,p[i]=mp(a[i],i);
    sort(p+1,p+n+1);
    rep(i,1,n ) pos[p[i].S]=i;

    dp2[1]=1;
    rep(i,0,1000000) seg[i]=0;

    update(1,1,n,pos[1],pos[1],1);

    rep(i,2,n){
        if(xs<=x2) dp2[i]=1+query(1,1,n,1,pos[i]);
        else dp2[i]=1+query(1,1,n,pos[i],n);
        update(1,1,n,pos[i],pos[i],dp2[i]);
    }


    rep(i,1,n) dp2[i]=max(dp2[i],dp2[i-1]);

    ld ans =  (ld) ( abs(x2-xs)*100.0+abs(y2-ys)*100.0 );

    ld ct = (ld) (max(dp[n],dp2[n]));
    ans -= ct*20.0;
    ans += (ct*pi*10.0/2.0);
    if(max(dp[n],dp2[n]) == min(abs(y2-ys)+1,abs(x2-xs)+1)) ans+=(pi*5.0);

    cout<<ans<<'\n';
}


Measured memory_bytes: 21612