#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<ll>::iterator sit;
typedef map<ll,ll>::iterator mit;
 
const ld PI = 3.14159265358979323846264338327;
 
bool intersect(ll l1, ll r1, ll l2, ll r2)
{
	if(r2<l2||r1<l1) return false;
	if(l1>=l2) 
	{
		swap(l1,l2); swap(r1,r2);
	}
	if(l2<=r1) return true;
	else return false;
}
 
int CeilIndex(std::vector<int> &v, int l, int r, int key) {
    while (r-l > 1) {
    int m = l + (r-l)/2;
    if (v[m] >= key)
        r = m;
    else
        l = m;
    }
 
    return r;
}
 
int LongestIncreasingSubsequenceLength(std::vector<int> &v) {
    if (v.size() == 0)
        return 0;
 
    std::vector<int> tail(v.size(), 0);
    int length = 1; // always points empty slot in tail
 
    tail[0] = v[0];
    for (size_t i = 1; i < v.size(); i++) {
        if (v[i] < tail[0])
            // new smallest value
            tail[0] = v[i];
        else if (v[i] > tail[length-1])
            // v[i] extends largest subsequence
            tail[length++] = v[i];
        else
            // v[i] will become end candidate of an existing subsequence or
            // Throw away larger elements in all LIS, to make room for upcoming grater elements than v[i]
            // (and also, v[i] would have already appeared in one of LIS, identify the location and replace it)
            tail[CeilIndex(tail, -1, length-1, v[i])] = v[i];
    }
 
    return length;
}
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll x1,y1,x2,y2;
	cin>>x1>>y1>>x2>>y2;
	if(x1>x2)
	{
		swap(x1,x2);
		swap(y1,y2);
	}
	vector<ii> pts;
	int n; cin>>n;
	for(int i=0;i<n;i++)
	{
		ll x,y;
		cin>>x>>y;
		if(x>=min(x1,x2)&&x<=max(x1,x2)&&y>=min(y1,y2)&&y<=max(y1,y2))
		{
			if(y1>y2)
			{
				x = x1 + x2 - x;
			}
			pts.pb(mp(x,y));
		}
	}
	if(y1>y2) swap(y1,y2);
	n=pts.size();
	ld ans = (abs(x2-x1)+abs(y2-y1))*100;
	ld ext = 20 - PI*5;
	/*
	bool ex = 1;
	vector<ii> parts;
	parts.pb(mp(min(y1,y2),max(y1,y2)));
	sort(pts.begin(),pts.end());
	for(int i=0;i<pts.size();i++)
	{
		if(i>0&&pts[i].fi-1>pts[i-1].fi)
		{
			parts.clear();
			parts.pb(mp(min(y1,y2),max(y1,y2)));
		}
		vector<ii> nw;
		vector<ii> cand;
		cand.pb(mp(min(y1,y2),pts[i].se-1));
		cand.pb(mp(pts[i].se+1,max(y1,y2)));
		for(int j=0;j<2;j++)
		{
			bool pos=0;
			for(int k=0;k<parts.size();k++)
			{
				if(intersect(parts[k].fi,parts[k].se,cand[j].fi,cand[j].se))
				{
					pos=1;
					break;
				}
			}
			if(pos) nw.pb(cand[j]);
		}
		parts=nw;
		if(parts.empty())
		{
			ex=0;
			break;
		}
	}
	*/

	ll LIS = 0;
	
	sort(pts.begin(),pts.end());
	vi Y;
	for(int i=0;i<n;i++)
	{
		Y.pb(pts[i].se);
	}
	sort(Y.begin(),Y.end());
	vi res;
	for(int i=0;i<n;i++)
	{
		res.pb(lower_bound(Y.begin(),Y.end(),pts[i].se)-Y.begin());
	}
	LIS = LongestIncreasingSubsequenceLength(res);
	if(LIS==min(abs(x2-x1),abs(y2-y1))+1){ans+=ext;ans+=10*PI-20;}
	cout<<fixed<<setprecision(20)<<ans - LIS*ext<<'\n';
}


Measured memory_bytes: 6892