#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <iomanip>
#include <stdio.h>
#include <string.h>
#include <random>
#include <functional>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::fill;

using std::setprecision;
using std::fixed;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;

ll min(ll a, ll b) {return a < b ? a : b;}
ll min(int a, ll b) {return a < b ? a : b;}
ll min(ll a, int b) {return a < b ? a : b;}
ll min(int a, int b) {return a < b ? a : b;}

ll max(ll a, ll b) {return a > b ? a : b;}
ll max(int a, ll b) {return a > b ? a : b;}
ll max(ll a, int b) {return a > b ? a : b;}
ll max(int a, int b) {return a > b ? a : b;}

namespace MySpace{

};

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()
#define y1 y1337
#define int long long

const long long MOD = 998244353;

long long inq(long long x, long long y)
{
    if (y == 0) return 1;
    long long l = inq(x, y / 2);
    if (y % 2) return l * l % MOD * x % MOD;
    return l * l % MOD;
}

const long double PI = acos(-1);
int x1, y1, x2, y2;
int n;
int x[500000], y[500000];
vector<pair<int, int> > a, b;
double ans;
int kek, LIM = 100000000;
int res = 0;

int comp(vector<int> ss)
{
    vector<int> f(ss.size() + 1, LIM + 1);
    for (auto x : ss)
        *upper_bound(f.begin(), f.end(), x) = x;
    return upper_bound(f.begin(), f.end(), LIM) - f.begin();
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2)
    {
        ans = 100.0 * abs(y2 - y1);
        int t = 0;
        cin >> n;
        for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
        for (int i = 0; i < n; i++) if (x[i] == x1 && min(y1, y2) < y[i] && y[i] < max(y1, y2)) t = 1;
        if (t) ans = ans - 20 + 10 * PI;
        printf("%.9f", ans);
        return 0;
    }
    if (y1 == y2)
    {
        ans = 100.0 * abs(x2 - x1);
        int t = 0;
        cin >> n;
        for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
        for (int i = 0; i < n; i++) if (y[i] == y1 && min(x1, x2) < x[i] && x[i] < max(x1, x2)) t = 1;
        if (t) ans = ans - 20 + 10 * PI;
        printf("%.9f", ans);
        return 0;
    }
    if (x1 > x2)
    {
        swap(x1, x2);
        swap(y1, y2);
    }
    if (y1 > y2)
    {
        y1 = LIM - y1;
        y2 = LIM - y2;
        kek = 1;
    }
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
        if (kek) y[i] = LIM - y[i];
        if (x1 <= x[i] && x[i] <= x2 && y1 <= y[i] && y[i] <= y2)
        {
            b.push_back({x[i], y[i]});
        }
    }
    ans = y2 - y1 + x2 - x1;
    sort(all(b));
    vector<int> d;
    for (int i = 0; i < b.size(); i++) d.push_back(b[i].second);
    int r2 = comp(d);
    double betta = 100 * ans - 20 * r2 + 5 * PI * r2;
    if (r2 == min(x2 - x1, y2 - y1) + 1) betta += 5 * PI;
    printf("%.18f", betta);
}


Measured memory_bytes: 14700