#include <iostream>
#include <fstream>
#include <sstream>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <set>

//#define DEBUG 1

#define int long long
#define for0(i,n) for (int i=0; i<n; i++)
#define iter(c) for(auto it=c.begin(); it!=c.end(); it++)
#define vec(x) vector< x >
#define pb push_back
#define ms(a,z) memset(a,z,sizeof(a));
#define mp make_pair
#define X first
#define Y second
#define sqr(x) 1LL*(x)*(x)
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define all(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#ifdef int
#define read(x) scanf("%lld",&x);
#else
#define read(x) scanf("%d",&x);
#endif

#ifdef DEBUG
#define nl cout<<"\n";
#define pr(x) cout<<(x)<<" ";
#define prl(x) cout<<#x " = "<<x<<endl;
#define prp(x) cout<<"("<<(x).first<<" "<<(x).second<<") ";
#define printv(v) {for(int _=0; _<sz(v); _++) cout<<v[_]<<" "; cout<<"\n";}
#define printa(a,s) {for (int _=0; _<s; _++) cout<<a[_]<<" "; cout<<"\n";}
#define print2D(a,m,n) {for (int _=0; _<m; _++) {for (int __=0; __<n; __++) cout<<a[_][__]<<" "; cout<<"\n";} cout<<"\n";}
#define debug cout<<"ok at line "<<__LINE__<<endl;
#else
#define nl
#define pr(x)
#define prl(x)
#define prp(x)
#define printv(v)
#define printa(a,s)
#define print2D(a,m,n)
#define debug
#endif


using namespace std;

typedef long long ll;
typedef pair<int,int> point;

const int INF = 2147483647;
const long long INFL = 9223372036854775807LL;
const double EPSILON = 0.00000001;
const long long MOD = 1000000007;
const double PI = 3.141592653589793238462643;
const double EXTRA_DIST = 10*PI - 20;
const double SHORTCUT = 20 - 5*PI;

// Binary search (note boundaries in the caller)
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,tail[length-1]};
    return length;
}

int32_t main()
{
    #ifdef DEBUG
    freopen("C.txt","r",stdin);
    //freopen("","w",stdout);
    #endif

    point start,end;
    cin >> start.X >> start.Y >> end.X >> end.Y;
    if (start.X > end.X) {
        swap(start,end);
    }
    int low = min(start.Y, end.Y);
    int high = max(start.Y, end.Y);
    double dist = 100 * (fabs(start.X - end.X) + fabs(start.Y - end.Y));
    prl(dist)
    
    vector<point> fountains;
    point end_fountain = {-1,-1};
    int n;
    cin >> n;
    for0(i,n) {
        int x,y;
        read(x); read(y);
        if (start.X <= x && x <= end.X && low <= y && y <= high) {
            //if (y == end.Y)
            //    end_fountain = {x,y};
            //else 
            fountains.pb({x,y});
        }
    }
    sort(all(fountains));
    vector<int> y_fountains;
    iter(fountains)
        y_fountains.pb(it->Y);
    printv(y_fountains);    
    
    int num_fountains, last_fountain;
    
    /*if (start.X == end.X or start.Y == end.Y){
        if (sz(y_fountains) > 0)
            dist += EXTRA_DIST;
    }
    if (end.Y > start.Y){
        tie(num_fountains, last_fountain) = LongestIncreasingSubsequenceLength(y_fountains);
    }*/
    if (end.Y < start.Y) {
        for0(i,sz(y_fountains))
            y_fountains[i] *= -1; 
        //tie(num_fountains, last_fountain) = LongestIncreasingSubsequenceLength(y_fountains); 
        //last_fountain *= -1;
    }
    num_fountains = LongestIncreasingSubsequenceLength(y_fountains);
    prl(num_fountains)
    //prl(last_fountain);
    if (num_fountains == min(high-low+1, end.X-start.X+1)) {
        dist -= SHORTCUT * (num_fountains-1);
        dist += EXTRA_DIST;
    }
    else 
        dist -= SHORTCUT * num_fountains;
    printf("%.9f\n",dist);
    return 0;
}


Measured memory_bytes: 7916