#include "bits/stdc++.h"
#if !defined(ONLINE_JUDGE)
#include "prettyprint/prettyprint.hpp"
#endif
using namespace std;
typedef long long ll;

#define all(x) x.begin(), x.end()
#define pi 3.14159265358979323846

template<class Container> istream& operator>> (istream &in, vector<Container> &c) {for(auto &x :c) in >> x; return in; }
template<class A, class B> istream& operator>> (istream &in, pair<A, B> &c) {in >> c.first >> c.second; return in; }
template<class Container> ll gcd(Container &a) { auto g = *a.begin(); for(auto &x : a) g = __gcd(g, x); return g; }
template<typename T> T Min(const T &a){ return a; }
template<typename T, typename ...Args> T Min(const T &a, const Args&... args) { T b = Min(args...); return (a < b ? a : b);}
template<typename T> T Max(const T &a) { return a; }
template<typename T, typename ...Args> T Max(const T &a, const Args&... args) { T b = Max(args...); return (a > b ? a : b); }
template<typename T> T gcd(const T &a){ return a; }

const int N = (int)1e6+2;
int tree[4*N];
void add(int v, int tl, int tr, int pos, int val)
{
    tree[v]+=val;
    if(tl == tr)
        return;
    int tm = (tl + tr) >> 1;
    (pos <= tm ? add((v << 1), tl, tm, pos, val) : add((v << 1 | 1), tm + 1, tr, pos, val));
}
int kth(int v, int tl, int tr, int k)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1] >= k) return kth(v << 1, tl, tm, k);
    else return kth(v << 1 | 1, tm + 1, tr, k - tree[v << 1]);
}
int findAnswer(int v, int tl, int tr)
{
    if(tl == tr)
        return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1]) return findAnswer(v << 1, tl, tm);
    else if(tree[v << 1 | 1]) return findAnswer(v << 1 | 1, tm + 1, tr);
    else return 0;
}
int main()
{
    int n, q; cin >> n >> q;
    int x;
    for(int i = 0; i < n; i++) {
        scanf("%d", &x);
        add(1, 0, N - 1, x, 1);
    }
    for(int i = 0; i < q; i++) {
        scanf("%d", &x);
        if(x < 0) {
            int v = kth(1, 0, N - 1, abs(x));
            add(1, 0, N - 1, v, -1);
        } else  add(1, 0, N - 1, x, 1);
    }
    printf("%d", findAnswer(1, 1, N - 1));
}


#include "bits/stdc++.h"
#if !defined(ONLINE_JUDGE)
#include "prettyprint/prettyprint.hpp"
#endif
using namespace std;
typedef long long ll;

#define all(x) x.begin(), x.end()
#define pi 3.14159265358979323846

template<class Container> istream& operator>> (istream &in, vector<Container> &c) {for(auto &x :c) in >> x; return in; }
template<class A, class B> istream& operator>> (istream &in, pair<A, B> &c) {in >> c.first >> c.second; return in; }
template<class Container> ll gcd(Container &a) { auto g = *a.begin(); for(auto &x : a) g = __gcd(g, x); return g; }
template<typename T> T Min(const T &a){ return a; }
template<typename T, typename ...Args> T Min(const T &a, const Args&... args) { T b = Min(args...); return (a < b ? a : b);}
template<typename T> T Max(const T &a) { return a; }
template<typename T, typename ...Args> T Max(const T &a, const Args&... args) { T b = Max(args...); return (a > b ? a : b); }
template<typename T> T gcd(const T &a){ return a; }

const int N = (int)1e6+2;
int tree[4*N];
void add(int v, int tl, int tr, int pos, int val)
{
    if(tl == pos && tl == tr) tree[v] += val;
    else {
        int tm = (tl + tr) >> 1;
        (pos <= tm ? add((v << 1), tl, tm, pos, val) : add((v << 1 | 1), tm + 1, tr, pos, val));
    }
    tree[v] = tree[v << 1] + tree[v << 1 | 1];
}
int kth(int v, int tl, int tr, int k)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1] >= k) return kth(v << 1, tl, tm, k);
    else return kth(v << 1 | 1, tm + 1, tr, k - tree[v << 1]);
}
int findAnswer(int v, int tl, int tr)
{
    if(!tree[v])
        return 0;
    if(tl == tr)
        return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1]) return findAnswer(v << 1, tl, tm);
    else if(tree[v << 1 | 1]) return findAnswer(v << 1 | 1, tm + 1, tr);
    else return 0;
}
int main()
{
    int n, q; cin >> n >> q;
    int x;
    for(int i = 0; i < n; i++) {
        scanf("%d", &x);
        add(1, 0, N - 1, x, 1);
    }
    for(int i = 0; i < q; i++) {
        scanf("%d", &x);
        int v = kth(1, 0, N - 1, abs(x));
        add(1, 0, N - 1, v, -1);
    }
    printf("%d", findAnswer(1, 0, N - 1));
}


#include "bits/stdc++.h"
#if !defined(ONLINE_JUDGE)
#include "prettyprint/prettyprint.hpp"
#endif
using namespace std;
typedef long long ll;

#define all(x) x.begin(), x.end()
#define pi 3.14159265358979323846

template<class Container> istream& operator>> (istream &in, vector<Container> &c) {for(auto &x :c) in >> x; return in; }
template<class A, class B> istream& operator>> (istream &in, pair<A, B> &c) {in >> c.first >> c.second; return in; }
template<class Container> ll gcd(Container &a) { auto g = *a.begin(); for(auto &x : a) g = __gcd(g, x); return g; }
template<typename T> T Min(const T &a){ return a; }
template<typename T, typename ...Args> T Min(const T &a, const Args&... args) { T b = Min(args...); return (a < b ? a : b);}
template<typename T> T Max(const T &a) { return a; }
template<typename T, typename ...Args> T Max(const T &a, const Args&... args) { T b = Max(args...); return (a > b ? a : b); }
template<typename T> T gcd(const T &a){ return a; }

const int N = 1e6+2;
int tree[4*N];
void add(int v, int tl, int tr, int pos, int val)
{
    if(tl == pos && tl == tr) tree[v] += val;
    else {
        int tm = (tl + tr) >> 1;
        (pos <= tm ? add((v << 1), tl, tm, pos, val) : add((v << 1 | 1), tm + 1, tr, pos, val));
        tree[v] = tree[v << 1] + tree[v << 1 | 1];
    }
}
int kth(int v, int tl, int tr, int k)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1] >= k) return kth(v << 1, tl, tm, k);
    else return kth(v << 1 | 1, tm + 1, tr, k - tree[v << 1]);
}
int findAnswer(int v, int tl, int tr)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1]) return findAnswer(v << 1, tl, tm);
    else if(tree[v << 1 | 1]) return findAnswer(v << 1 | 1, tm + 1, tr);
    else return 0;
}
int main()
{
    int n, q; cin >> n >> q;
    int x;
    for(int i = 0; i < n; i++) {
        add(1, 0, N - 1, (cin >> x, x), 1);
    }
    for(int i = 0; i < q; i++) {
        int v = kth(1, 0, N - 1, abs((cin >> x, x)));
        add(1, 0, N - 1, v, -1);
    }
    printf("%d", findAnswer(1, 0, N - 1));
}


#include "bits/stdc++.h"
#if !defined(ONLINE_JUDGE)
#include "prettyprint/prettyprint.hpp"
#endif
using namespace std;
typedef long long ll;

#define all(x) x.begin(), x.end()
#define pi 3.14159265358979323846

template<class Container> istream& operator>> (istream &in, vector<Container> &c) {for(auto &x :c) in >> x; return in; }
template<class A, class B> istream& operator>> (istream &in, pair<A, B> &c) {in >> c.first >> c.second; return in; }
template<class Container> ll gcd(Container &a) { auto g = *a.begin(); for(auto &x : a) g = __gcd(g, x); return g; }
template<typename T> T Min(const T &a){ return a; }
template<typename T, typename ...Args> T Min(const T &a, const Args&... args) { T b = Min(args...); return (a < b ? a : b);}
template<typename T> T Max(const T &a) { return a; }
template<typename T, typename ...Args> T Max(const T &a, const Args&... args) { T b = Max(args...); return (a > b ? a : b); }
template<typename T> T gcd(const T &a){ return a; }

const int N = 6;
int tree[4*N];
void add(int v, int tl, int tr, int pos, int val)
{
    if(tl == pos && tl == tr) tree[v] += val;
    else {
        int tm = (tl + tr) >> 1;
        (pos <= tm ? add((v << 1), tl, tm, pos, val) : add((v << 1 | 1), tm + 1, tr, pos, val));
        tree[v] = tree[v << 1] + tree[v << 1 | 1];
    }
}
int kth(int v, int tl, int tr, int k)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1] >= k) return kth(v << 1, tl, tm, k);
    else return kth(v << 1 | 1, tm + 1, tr, k - tree[v << 1]);
}
int findAnswer(int v, int tl, int tr)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1]) return findAnswer(v << 1, tl, tm);
    else if(tree[v << 1 | 1]) return findAnswer(v << 1 | 1, tm + 1, tr);
    else return 0;
}
int main()
{
    int n, q; cin >> n >> q;
    vector<int> a(n), t(q);
    cin >> a >> t;
    for(auto &x : a)
        add(1, 0, N - 1, x, 1);
    for(auto &x : t) {
        int v = kth(1, 0, N - 1, abs(x));
        add(1, 0, N - 1, v, -1);
    }
    cout << findAnswer(1, 0, N - 1);
}


#include "bits/stdc++.h"
#if !defined(ONLINE_JUDGE)
#include "prettyprint/prettyprint.hpp"
#endif
using namespace std;
typedef long long ll;

#define all(x) x.begin(), x.end()
#define pi 3.14159265358979323846

template<class Container> istream& operator>> (istream &in, vector<Container> &c) {for(auto &x :c) in >> x; return in; }
template<class A, class B> istream& operator>> (istream &in, pair<A, B> &c) {in >> c.first >> c.second; return in; }
template<class Container> ll gcd(Container &a) { auto g = *a.begin(); for(auto &x : a) g = __gcd(g, x); return g; }
template<typename T> T Min(const T &a){ return a; }
template<typename T, typename ...Args> T Min(const T &a, const Args&... args) { T b = Min(args...); return (a < b ? a : b);}
template<typename T> T Max(const T &a) { return a; }
template<typename T, typename ...Args> T Max(const T &a, const Args&... args) { T b = Max(args...); return (a > b ? a : b); }
template<typename T> T gcd(const T &a){ return a; }

const int N = (int)1e6+2;
int tree[4*N];
void add(int v, int tl, int tr, int pos, int val)
{
    if(tl == pos && tl == tr) tree[v] += val;
    else {
        int tm = (tl + tr) >> 1;
        (pos <= tm ? add((v << 1), tl, tm, pos, val) : add((v << 1 | 1), tm + 1, tr, pos, val));
        tree[v] = tree[v << 1] + tree[v << 1 | 1];
    }
}
int kth(int v, int tl, int tr, int k)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1] >= k) return kth(v << 1, tl, tm, k);
    else return kth(v << 1 | 1, tm + 1, tr, k - tree[v << 1]);
}
int findAnswer(int v, int tl, int tr)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1]) return findAnswer(v << 1, tl, tm);
    else if(tree[v << 1 | 1]) return findAnswer(v << 1 | 1, tm + 1, tr);
    else return 0;
}
int main()
{
    int n, q; cin >> n >> q;
    int x;
    for(int i = 0; i < n; i++) {
        scanf("%d", &x);
        add(1, 0, N - 1, x, 1);
    }
    for(int i = 0; i < q; i++) {
        scanf("%d", &x);
        int v = kth(1, 0, N - 1, abs(x));
        add(1, 0, N - 1, v, -1);
    }
    printf("%d", findAnswer(1, 0, N - 1));
}


#include "bits/stdc++.h"
#if !defined(ONLINE_JUDGE)
#include "prettyprint/prettyprint.hpp"
#endif
using namespace std;
typedef long long ll;

#define all(x) x.begin(), x.end()
#define pi 3.14159265358979323846

template<class Container> istream& operator>> (istream &in, vector<Container> &c) {for(auto &x :c) in >> x; return in; }
template<class A, class B> istream& operator>> (istream &in, pair<A, B> &c) {in >> c.first >> c.second; return in; }
template<class Container> ll gcd(Container &a) { auto g = *a.begin(); for(auto &x : a) g = __gcd(g, x); return g; }
template<typename T> T Min(const T &a){ return a; }
template<typename T, typename ...Args> T Min(const T &a, const Args&... args) { T b = Min(args...); return (a < b ? a : b);}
template<typename T> T Max(const T &a) { return a; }
template<typename T, typename ...Args> T Max(const T &a, const Args&... args) { T b = Max(args...); return (a > b ? a : b); }
template<typename T> T gcd(const T &a){ return a; }

const int N = 1e6+2;
int tree[4*N];
void add(int v, int tl, int tr, int pos, int val)
{
    if(tl == pos && tl == tr) tree[v] += val;
    else {
        int tm = (tl + tr) >> 1;
        (pos <= tm ? add((v << 1), tl, tm, pos, val) : add((v << 1 | 1), tm + 1, tr, pos, val));
        tree[v] = tree[v << 1] + tree[v << 1 | 1];
    }
}
int kth(int v, int tl, int tr, int k)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1] >= k) return kth(v << 1, tl, tm, k);
    else return kth(v << 1 | 1, tm + 1, tr, k - tree[v << 1]);
}
int findAnswer(int v, int tl, int tr)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1]) return findAnswer(v << 1, tl, tm);
    else if(tree[v << 1 | 1]) return findAnswer(v << 1 | 1, tm + 1, tr);
    else return 0;
}
int main()
{
    int n, q; cin >> n >> q;
    int x;
    for(int i = 0; i < n; i++) {
        scanf("%d", &x);
        add(1, 0, N - 1, x, 1);
    }
    for(int i = 0; i < q; i++) {
        scanf("%d", &x);
        int v = kth(1, 0, N - 1, abs(x));
        add(1, 0, N - 1, v, -1);
    }
    printf("%d", findAnswer(1, 0, N - 1));
}


#include "bits/stdc++.h"
#if !defined(ONLINE_JUDGE)
#include "prettyprint/prettyprint.hpp"
#endif
using namespace std;
typedef long long ll;

#define all(x) x.begin(), x.end()
#define pi 3.14159265358979323846

template<class Container> istream& operator>> (istream &in, vector<Container> &c) {for(auto &x :c) in >> x; return in; }
template<class A, class B> istream& operator>> (istream &in, pair<A, B> &c) {in >> c.first >> c.second; return in; }
template<class Container> ll gcd(Container &a) { auto g = *a.begin(); for(auto &x : a) g = __gcd(g, x); return g; }
template<typename T> T Min(const T &a){ return a; }
template<typename T, typename ...Args> T Min(const T &a, const Args&... args) { T b = Min(args...); return (a < b ? a : b);}
template<typename T> T Max(const T &a) { return a; }
template<typename T, typename ...Args> T Max(const T &a, const Args&... args) { T b = Max(args...); return (a > b ? a : b); }
template<typename T> T gcd(const T &a){ return a; }

const int N = 6;
int tree[4*N];
void add(int v, int tl, int tr, int pos, int val)
{
    if(tl == pos && tl == tr) tree[v] += val;
    else {
        int tm = (tl + tr) >> 1;
        (pos <= tm ? add((v << 1), tl, tm, pos, val) : add((v << 1 | 1), tm + 1, tr, pos, val));
        tree[v] = tree[v << 1] + tree[v << 1 | 1];
    }
}
int kth(int v, int tl, int tr, int k)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1] >= k) return kth(v << 1, tl, tm, k);
    else return kth(v << 1 | 1, tm + 1, tr, k - tree[v << 1]);
}
int findAnswer(int v, int tl, int tr)
{
    if(tl == tr) return tl;
    int tm = (tl + tr) >> 1;
    if(tree[v << 1]) return findAnswer(v << 1, tl, tm);
    else if(tree[v << 1 | 1]) return findAnswer(v << 1 | 1, tm + 1, tr);
    else return 0;
}
int main()
{
    int n, q; cin >> n >> q;
    int x;
    for(int i = 0; i < n; i++) {
        add(1, 0, N - 1, (cin >> x, x), 1);
    }
    for(int i = 0; i < q; i++) {
        int v = kth(1, 0, N - 1, abs((cin >> x, x)));
        add(1, 0, N - 1, v, -1);
    }
    printf("%d", findAnswer(1, 0, N - 1));
}


#include<bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(0);cin.tie(0)
#define trace(x) cerr << #x << ": " << x << endl

int n, m, x, q;
/////////////////////////////////////////////////

int BIT[1100001];
void update(int x, int delta) {
      for(; x <= 1100001; x += x&-x)
        BIT[x] += delta;
}

int query(int x) {
     int sum = 0;
     for(; x > 0; x -= x&-x)
        sum += BIT[x];
     return sum;
}

int binary_search_bit(int k) {
    int l = 1, r = n;
    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (query(mid) >= k)
            r = mid;
        else
            l = mid + 1;
    }
    return query(l) >= x ? l : r;
}

void purple()
{
    cin >> n >> q;

    for(int i = 0; i < n; i++) {
        cin >> x;
        update(x, 1);
    }
    for(int i = 0; i < 20; i++) {
        cout << i << " " << BIT[i] << endl;
    }
    while (q--) {
        cin >> x;
        if(x > 0)
            update(x, 1);
        else {
            x = abs(x);
            int pre = 0;
            int mask = 0;
            int toGather = x;
            for(int i = 20; i >= 0; i--) {
                // cout << i << "," << (1<<i) << endl;
                if(pre + BIT[mask|(1<<i)] < toGather) {
                    // trace(toGather);
                    mask |= (1<<i);
                    pre += BIT[mask];
                    // toGather -= BIT[mask];
                }
                // trace(mask);
            }

            // cout << "updating" << (mask + 1) << endl;
            update(mask + 1, -1);
        }
    }

    for(int i = 1; i <=1000000 ; i++) {
        if(query(i)) {
            cout << i;
            return;
        }
    }
    cout << 0;
}

signed main() {
    boost;
    int t=1;
    while(t--) purple();
}


#include<bits/stdc++.h>
#define ll int
#define N 1000005
using namespace std;
ll tree[2*N];
ll find(ll low,ll high,ll node,ll k)
{
	ll mid=low+(high-low)/2;

	if(low==high)
		return low;

	if(tree[2*node]>=k)
		return find(low,mid,2*node,k);
	else
		return find(mid+1,high,2*node+1,k-tree[2*node]);

}
void update(ll low,ll high,ll node,ll k,ll opr)
{

	ll mid=low+(high-low)/2;
	if(low==high)
	{
		tree[node]+=opr;
		return ;
	}
	if(k<=mid)
		update(low,mid,2*node,k,opr);
	else
		update(mid+1,high,2*node+1,k,opr);
	tree[node]=tree[2*node]+tree[2*node+1];

}
int main()
{
 	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	//Hello Frands Code Dekhlo
	ll n,q;
	cin>>n>>q;
	memset(tree,0,sizeof(tree));
	ll i;
	for(i=0;i<n;i++)
	{
		ll k;
		cin>>k;
		update(1,n,1,k,1);
	}

	while(q--)
	{
		ll k;
		cin>>k;
		if(k>0)
			update(1,n,1,k,1);
		else
		{
			ll key=find(1,n,1,-k);
			update(1,n,1,key,-1);
		}
	}

	if(tree[1]==0)
		cout<<"0"<<endl;
	else
		cout<<find(1,n,1,1)<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define vec vector
#define pb push_back
#define s(x) scanf("%d",&x)
#define all(x)	x.begin(),x.end()
#define pii pair<int,int>
#define fi first
#define se second
#define mod 1000000007
#define SZ 200005
#define endl "\n"
#define trace(x) cerr << #x << ": " << x << endl
#define boost ios::sync_with_stdio(0);cin.tie(0)

int n, m, x, q;
/////////////////////////////////////////////////
int BIT[1000001];
void update(int x, int delta) {
      for(; x <= n; x += x&-x)
        BIT[x] += delta;
}

int query(int x) {
     int sum = 0;
     for(; x > 0; x -= x&-x)
        sum += BIT[x];
     return sum;
}

int binary_search_bit(int k) {
    int l = 1, r = n;
    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (query(mid) >= k)
            r = mid;
        else
            l = mid + 1;
    }
    return query(l) >= x ? l : r;
}

void purple()
{
    cin >> n >> q;

    for(int i = 0; i < n; i++) {
        cin >> x;
        update(x, 1);
    }
    while (q--) {
        cin >> x;
        if(x>0)
        update(x, 1);
        else {
            x = abs(x);
            update(binary_search_bit(x), -1);
        }
    }

    for(int i = 1; i <=1000000 ; i++) {
        if(query(i)) {
            cout << i;
            return;
        }
    }
    cout << 0;
}

signed main() {
    boost;
    int t=1;
    while(t--) purple();
}


#include<bits/stdc++.h>
using namespace std;
// #define int long long int
#define vec vector
#define pb push_back
#define s(x) scanf("%d",&x)
#define all(x)	x.begin(),x.end()
#define pii pair<int,int>
#define fi first
#define se second
#define mod 1000000007
#define SZ 200005
#define endl "\n"
#define trace(x) cerr << #x << ": " << x << endl
#define boost ios::sync_with_stdio(0);cin.tie(0)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int  m, x,n,q,k,kth;
/////////////////////////////////////////////////

#define trace(x) cerr << #x << ": " << x << endl

void purple()
{

    ordered_set s;
    cin >> n >>q;
    for(int i=0;i<n;i++) {
        cin >> x;
        s.insert(x);
    }
    while(q--) {
        cin >> x;
        if(k>0)
        s.insert(x);
        else {
            x=-x;
            auto it = s.find_by_order(x-1);
            trace(*it);
            s.erase(it);
        }
    }
    if(s.size()>0)
    cout << *s.begin();
    else
    cout << 0<<endl;
}

signed main() {
    boost;
    int t=1;
    // cin>>t;
    while(t--) purple();
}


#include<bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(0);cin.tie(0)
#define trace(x) cerr << #x << ": " << x << endl

int n, m, x, q;
/////////////////////////////////////////////////

int BIT[1100001];
void update(int x, int delta) {
      for(; x <= 1100001; x += x&-x)
        BIT[x] += delta;
}

int query(int x) {
     int sum = 0;
     for(; x > 0; x -= x&-x)
        sum += BIT[x];
     return sum;
}

int binary_search_bit(int k) {
    int l = 1, r = n;
    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (query(mid) >= k)
            r = mid;
        else
            l = mid + 1;
    }
    return query(l) >= x ? l : r;
}

void purple()
{
    cin >> n >> q;

    for(int i = 0; i < n; i++) {
        cin >> x;
        update(x, 1);
    }
    for(int i = 0; i < 20; i++) {
        cout << i << " " << BIT[i] << endl;
    }
    while (q--) {
        cin >> x;
        if(x > 0)
            update(x, 1);
        else {
            x = abs(x);
            int pre = 0;
            int mask = 0;
            int toGather = x;
            for(int i = 20; i >= 0; i--) {
                cout << i << "," << (1<<i) << endl;
                if(pre + BIT[mask|(1<<i)] < toGather) {
                    trace(toGather);
                    mask |= (1<<i);
                    pre += BIT[mask];
                    // toGather -= BIT[mask];
                }
                trace(mask);
            }

            // cout << "updating" << (mask + 1) << endl;
            update(mask + 1, -1);
        }
    }

    for(int i = 1; i <=1000000 ; i++) {
        if(query(i)) {
            cout << i;
            return;
        }
    }
    cout << 0;
}

signed main() {
    boost;
    int t=1;
    while(t--) purple();
}


#include<bits/stdc++.h>
using namespace std;
#define int short
#define vec vector
#define pb push_back
#define s(x) scanf("%d",&x)
#define all(x)	x.begin(),x.end()
#define pii pair<int,int>
#define fi first
#define se second
#define mod 1000000007
#define SZ 200005
#define endl "\n"
#define trace(x) cerr << #x << ": " << x << endl
#define boost ios::sync_with_stdio(0);cin.tie(0)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int  m, x,n,q,k,kth;
/////////////////////////////////////////////////

#define trace(x) cerr << #x << ": " << x << endl

void purple()
{

    ordered_set s;
    cin >> n >>q;
    for(int i=0;i<n;i++) {
        cin >> x;
        s.insert(x);
    }
    while(q--) {
        cin >> x;
        if(x>0)
        s.insert(x);
        else {
            x=-x;
            auto it = s.find_by_order(x-1);
            // trace(*it);
            s.erase(it);
        }
    }
    if(s.size()>0)
    cout << *s.begin();
    else
    cout << 0<<endl;
}

signed main() {
    boost;
    int t=1;
    // cin>>t;
    while(t--) purple();
}


#include<bits/stdc++.h>
#define ll int
#define N 1000005
using namespace std;
ll tree[4*N];
ll find(ll low,ll high,ll node,ll k)
{
	ll mid=low+(high-low)/2;

	if(low==high)
		return low;

	if(tree[2*node]>=k)
		return find(low,mid,2*node,k);
	else
		return find(mid+1,high,2*node+1,k-tree[2*node]);

}
void update(ll low,ll high,ll node,ll k,ll opr)
{

	ll mid=low+(high-low)/2;
	if(low==high)
	{
		tree[node]+=opr;
		return ;
	}
	if(k<=mid)
		update(low,mid,2*node,k,opr);
	else
		update(mid+1,high,2*node+1,k,opr);
	tree[node]=tree[2*node]+tree[2*node+1];

}
int main()
{
 	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	//Hello Frands Code Dekhlo
	ll n,q;
	cin>>n>>q;
	memset(tree,0,sizeof(tree));
	ll i;
	for(i=0;i<n;i++)
	{
		ll k;
		cin>>k;
		update(1,n,1,k,1);
	}

	while(q--)
	{
		ll k;
		cin>>k;
		if(k>0)
			update(1,n,1,k,1);
		else
		{
			ll key=find(1,n,1,-k);
			update(1,n,1,key,-1);
		}
	}

	if(tree[1]==0)
		cout<<"0"<<endl;
	else
		cout<<find(1,n,1,1)<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(0);cin.tie(0)
#define trace(x) cerr << #x << ": " << x << endl

int n, m, x, q;
/////////////////////////////////////////////////

int BIT[1100001];
void update(int x, int delta) {
      for(; x <= 1100001; x += x&-x)
        BIT[x] += delta;
}

int query(int x) {
     int sum = 0;
     for(; x > 0; x -= x&-x)
        sum += BIT[x];
     return sum;
}

int find_kth(int k) {
    int pre = 0;
    int mask = 0;
    for (int i = 20; i >= 0; i--) {
        if (pre + BIT[mask | (1 << i)] < k) {
            mask |= (1 << i);
            pre += BIT[mask];
        }
    }
    return mask + 1;
}

void purple()
{
    cin >> n >> q;

    for(int i = 0; i < n; i++) {
        cin >> x;
        update(x, 1);
    }

    while (q--) {
        cin >> x;
        if(x > 0)
            update(x, 1);
        else {
            x = abs(x);
            update(find_kth(x), -1);
        }
    }

    for(int i = 1; i <=1000000 ; i++) {
        if(query(i)) {
            cout << i;
            return;
        }
    }
    cout << 0;
}

signed main() {
    boost;
    int t=1;
    while(t--) purple();
}


#include<bits/stdc++.h>
using namespace std;
// #define int long long int
#define vec vector
#define pb push_back
#define s(x) scanf("%d",&x)
#define all(x)	x.begin(),x.end()
#define pii pair<int,int>
#define fi first
#define se second
#define mod 1000000007
#define SZ 200005
#define endl "\n"
#define trace(x) cerr << #x << ": " << x << endl
#define boost ios::sync_with_stdio(0);cin.tie(0)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int  m, x,n,q,k,kth;
/////////////////////////////////////////////////

#define trace(x) cerr << #x << ": " << x << endl

void purple()
{

    ordered_set s;
    cin >> n >>q;
    for(int i=0;i<n;i++) {
        cin >> x;
        s.insert(x);
    }
    while(q--) {
        cin >> x;
        if(k>0)
        s.insert(x);
        else {
            x=-x;
            auto it = s.find_by_order(x-1);
            // trace(*it);
            s.erase(it);
        }
    }
    if(s.size()>0)
    cout << *s.begin();
    else
    cout << 0<<endl;
}

signed main() {
    boost;
    int t=1;
    // cin>>t;
    while(t--) purple();
}


#include<bits/stdc++.h>
#define ll long long
#define N 1000005
using namespace std;
ll tree[4*N];
ll find(ll low,ll high,ll node,ll k)
{
	ll mid=low+(high-low)/2;

	if(low==high)
		return low;

	if(tree[2*node]>=k)
		return find(low,mid,2*node,k);
	else
		return find(mid+1,high,2*node+1,k-tree[2*node]);

}
void update(ll low,ll high,ll node,ll k,ll opr)
{

	ll mid=low+(high-low)/2;
	if(low==high)
	{
		tree[node]+=opr;
		return ;
	}
	if(k<=mid)
		update(low,mid,2*node,k,opr);
	else
		update(mid+1,high,2*node+1,k,opr);
	tree[node]=tree[2*node]+tree[2*node+1];

}
main()
{
 	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	//Hello Frands Code Dekhlo
	ll n,q;
	cin>>n>>q;
	memset(tree,0,sizeof(tree));
	ll i;
	for(i=0;i<n;i++)
	{
		ll k;
		cin>>k;
		update(1,n,1,k,1);
	}

	while(q--)
	{
		ll k;
		cin>>k;
		if(k>0)
			update(1,n,1,k,1);
		else
		{
			ll key=find(1,n,1,-k);
			update(1,n,1,key,-1);
		}
	}

	if(tree[1]==0)
		cout<<"0"<<endl;
	else
		cout<<find(1,n,1,1)<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define vec vector
#define pb push_back
#define s(x) scanf("%d",&x)
#define all(x)	x.begin(),x.end()
#define pii pair<int,int>
#define fi first
#define se second
#define mod 1000000007
#define SZ 200005
#define endl "\n"
#define trace(x) cerr << #x << ": " << x << endl
#define boost ios::sync_with_stdio(0);cin.tie(0)

int n, m, x, q;
/////////////////////////////////////////////////
int BIT[1000001];
void update(int x, int delta)
{
      for(; x <= n; x += x&-x)
        BIT[x] += delta;
}
int query(int x)
{
     int sum = 0;
     for(; x > 0; x -= x&-x)
        sum += BIT[x];
     return sum;
}

void purple()
{
    cin >> n >> q;

    for(int i = 0; i < n; i++) {
        cin >> x;
        update(x, 1);
    }
    while (q--)
    {
        cin >> x;
        if(x>0)
        update(x, 1);
        else
        {
            x = -x;
            int s = 1, e = n;
            while(e-s > 1) {
                int m = (s+e)/2;
                int count = query(m);
                if(count < x) s=m+1;
                else e=m;
            }
            if(query(s) >= x) update(s, -1);
            else update(e, -1);
        }
    }
    for(int i = 1; i <=1000000 ; i++) {
        if(query(i))
        {
            cout << i;
            return;
        }
    }
    cout << 0;
}

signed main() {
    boost;
    int t=1;
    // cin>>t;
    while(t--) purple();
}


#include<bits/stdc++.h>
#define ll long long
#define N 1000005
using namespace std;
ll tree[4*N];
ll find(ll low,ll high,ll node,ll k)
{
	ll mid=low+(high-low)/2;

	if(low==high)
		return low;

	if(tree[2*node]>=k)
		return find(low,mid,2*node,k);
	else
		return find(mid+1,high,2*node+1,k-tree[2*node]);

}
void update(ll low,ll high,ll node,ll k,ll opr)
{

	ll mid=low+(high-low)/2;
	if(low==high)
	{
		tree[node]+=opr;
		return ;
	}
	if(k<=mid)
		update(low,mid,2*node,k,opr);
	else
		update(mid+1,high,2*node+1,k,opr);
	tree[node]=tree[2*node]+tree[2*node+1];

}
int main()
{
 	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	//Hello Frands Code Dekhlo
	ll n,q;
	cin>>n>>q;
	memset(tree,0,sizeof(tree));
	ll i;
	for(i=0;i<n;i++)
	{
		ll k;
		cin>>k;
		update(1,n,1,k,1);
	}

	while(q--)
	{
		ll k;
		cin>>k;
		if(k>0)
			update(1,n,1,k,1);
		else
		{
			ll key=find(1,n,1,-k);
			update(1,n,1,key,-1);
		}
	}

	if(tree[1]==0)
		cout<<"0"<<endl;
	else
		cout<<find(1,n,1,1)<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(0);cin.tie(0)

int n, m, x, q;
/////////////////////////////////////////////////

int BIT[1000001];
void update(int x, int delta) {
      for(; x <= n; x += x&-x)
        BIT[x] += delta;
}

int query(int x) {
     int sum = 0;
     for(; x > 0; x -= x&-x)
        sum += BIT[x];
     return sum;
}

int binary_search_bit(int k) {
    int l = 1, r = n;
    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (query(mid) >= k)
            r = mid;
        else
            l = mid + 1;
    }
    return query(l) >= x ? l : r;
}

void purple()
{
    cin >> n >> q;

    for(int i = 0; i < n; i++) {
        cin >> x;
        update(x, 1);
    }
    while (q--) {
        cin >> x;
        if(x > 0)
            update(x, 1);
        else {
            x = abs(x);
            update(binary_search_bit(x), -1);
        }
    }

    for(int i = 1; i <=1000000 ; i++) {
        if(query(i)) {
            cout << i;
            return;
        }
    }
    cout << 0;
}

signed main() {
    boost;
    int t=1;
    while(t--) purple();
}


#include<bits/stdc++.h>
using namespace std;
// #define int long long int
#define vec vector
#define pb push_back
#define s(x) scanf("%d",&x)
#define all(x)	x.begin(),x.end()
#define pii pair<int,int>
#define fi first
#define se second
#define mod 1000000007
#define SZ 200005
#define endl "\n"
#define trace(x) cerr << #x << ": " << x << endl
#define boost ios::sync_with_stdio(0);cin.tie(0)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int  m, x,n,q,k,kth;
/////////////////////////////////////////////////

#define trace(x) cerr << #x << ": " << x << endl

void purple()
{

    ordered_set s;
    cin >> n >>q;
    for(int i=0;i<n;i++) {
        cin >> x;
        s.insert(x);
    }
    while(q--) {
        cin >> x;
        if(x>0)
        s.insert(x);
        else {
            x=-x;
            auto it = s.find_by_order(x-1);
            // trace(*it);
            s.erase(it);
        }
    }
    if(s.size()>0)
    cout << *s.begin();
    else
    cout << 0<<endl;
}

signed main() {
    boost;
    int t=1;
    // cin>>t;
    while(t--) purple();
}


#include<bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(0);cin.tie(0)
#define trace(x) cerr << #x << ": " << x << endl

int n, m, x, q;
/////////////////////////////////////////////////

int BIT[1100001];
void update(int x, int delta) {
      for(; x <= 1100001; x += x&-x)
        BIT[x] += delta;
}

int query(int x) {
     int sum = 0;
     for(; x > 0; x -= x&-x)
        sum += BIT[x];
     return sum;
}

int binary_search_bit(int k) {
    int l = 1, r = n;
    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (query(mid) >= k)
            r = mid;
        else
            l = mid + 1;
    }
    return query(l) >= x ? l : r;
}

void purple()
{
    cin >> n >> q;

    for(int i = 0; i < n; i++) {
        cin >> x;
        update(x, 1);
    }
    // for(int i = 0; i < 20; i++) {
    //     cout << i << " " << BIT[i] << endl;
    // }
    while (q--) {
        cin >> x;
        if(x > 0)
            update(x, 1);
        else {
            x = abs(x);
            int pre = 0;
            int mask = 0;
            int toGather = x;
            for(int i = 20; i >= 0; i--) {
                // cout << i << "," << (1<<i) << endl;
                if(pre + BIT[mask|(1<<i)] < toGather) {
                    // trace(toGather);
                    mask |= (1<<i);
                    pre += BIT[mask];
                    // toGather -= BIT[mask];
                }
                // trace(mask);
            }

            // cout << "updating" << (mask + 1) << endl;
            update(mask + 1, -1);
        }
    }

    for(int i = 1; i <=1000000 ; i++) {
        if(query(i)) {
            cout << i;
            return;
        }
    }
    cout << 0;
}

signed main() {
    boost;
    int t=1;
    while(t--) purple();
}


#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
    int n,l;
    int a[1005];
    while(scanf("%d%d",&n,&l)!=EOF)
    {
        for(int i=0;i<n;i++) scanf("%d",&a[i]);
        sort(a,a+n);
        double ans=max(a[0],l-a[n-1]);
        for(int i=1;i<n;i++)
        {
            ans=max(ans,(a[i]-a[i-1])/2.0);
        }
        printf("%.10lf\n",ans);
    }
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int n, l, r;
    cin >> n >> l;
    int p[n];

    for (int i = 0; i < n; i++)
        cin >> p[i];

    sort(p, p + n);
    r = max(p[0], l - p[n - 1]) * 2;

    for (int i = 0; i < n - 1; i++)
        r = max(r, p[i + 1] - p[i]);

    cout.precision(20);
    cout << fixed << r / 2.0 << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,l,i,maxx=0;
    double x,y,z,ans;
    scanf("%lld%lld",&n,&l);
    long long int a[n];
    for(i=0; i<n; i++)
    {
        scanf("%lld",&a[i]);
    }
    sort(a,a+n);
    for(i=0; i<n-1; i++)
    {
        if(a[i+1]-a[i]>maxx)
            maxx=a[i+1]-a[i];
    }
    x=maxx/2.0;
    y=a[0]-0.0;
    z=(double)l-a[n-1];
    ans=max(y,z);
    ans=max(ans,x);
    printf("%.10f\n",ans);
    return 0;
}


#include <vector>
#include <string>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <iterator>
#include <cmath>

/* Set of defines to make coding easier*/
#define PI std::acos(-1.0)

/* Set all typedefs to make life easier */
typedef long long int LLI;
typedef long double LD;
typedef unsigned long UL;
typedef unsigned long long int ULLI;

LD compute(std::vector<LLI>& nodes, const UL& streetlen)
{
  LD dist = 0;
  if (nodes.at(0) != 0)
    dist = nodes.at(0);
  UL i = 0;
  for (; i < nodes.size(); ++i)
    {
      if (i < nodes.size() -1)
	{
	  if ((nodes.at(i+1) - nodes.at(i))*.5 > dist)
	    {
	      dist = (nodes.at(i+1) - nodes.at(i))*0.5 ;
	    }
	}
    }
  if (nodes.at(i - 1) != streetlen && (streetlen - nodes.at(i - 1) > dist))
    dist = streetlen - nodes.at(i - 1);
  return dist;
}

LD process()
{
  UL n, l;
  std::cin >> n >> l;
  std::vector<LLI> v_nodes;
  for (UL i = 0; i < n; ++i)
    {
      LLI tmp;
      std::cin >> tmp;
      v_nodes.push_back(tmp);
    }
  std::sort(v_nodes.begin(), v_nodes.end());
  return compute(v_nodes, l);
}

int main(int argc, char *argv[])
{
  //  std::cout << std::fixed;
  std::cout << std::fixed << std::setprecision(10) << process() << std::endl;
  return 0;
}


#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <cmath>

/* Set of defines to make coding easier*/
#define PI std::acos(-1.0)

/* Set all typedefs to make life easier */
typedef long long int LLI;
typedef long double LD;
typedef unsigned long UL;
typedef unsigned long long int ULLI;

LD compute(std::vector<LLI>& nodes, const UL& streetlen)
{
  LD dist = 0;
  for (int i = 0; i < nodes.size(); ++i)
    {
      if (i < nodes.size() -1)
	{
	  if ((nodes.at(i+1) - nodes.at(i))*.5 > dist)
	    {
	      dist = (nodes.at(i+1) - nodes.at(i))*0.5 ;
	    }
	}
    }
  return dist;
}

LD process()
{
  UL n, l;
  std::cin >> n >> l;
  std::vector<LLI> v_nodes;
  for (UL i = 0; i < n; ++i)
    {
      LLI tmp;
      std::cin >> tmp;
      v_nodes.push_back(tmp);
    }
  std::sort(v_nodes.begin(), v_nodes.end());
  if (v_nodes.at(0) != 0)
    {
      auto it = v_nodes.begin();
      v_nodes.insert(it, 0);
    }
  auto it = v_nodes.end();
  --it;
  v_nodes.push_back(n);
  return compute(v_nodes, l);
}

int main(int argc, char *argv[])
{
  std::cout << process()  << std::endl;
  return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main(void)
{
	int n, l;
	std::cin >> n >> l;

	std::vector<int> a;
	for (int i = 0; i < n; ++i)
	{
		int t;
		std::cin >> t;
		a.push_back(t);
	}
	std::sort(a.begin(), a.end());
	int maximum = 2*a[0];
	for (int i = 1; i < n; ++i)
	{
		int distance = a[i] - a[i-1];
		if (maximum < distance)
			maximum = distance;
	}
	{
		int distance = 2*(l-a[n-1]);
		if (maximum < distance)
			maximum = distance;
	}
#if 0
	std::cout << maximum/2 << (maximum % 2 ? ".5" : "") << '\n';
#else
	std::cout << std::scientific << std::setprecision(20);
	std::cout << maximum/2. << '\n';
#endif
}


#include <algorithm>
#include <iostream>
#include <vector>

int main(void)
{
	int n, l;
	std::cin >> n >> l;

	std::vector<int> a;
	for (int i = 0; i < n; ++i)
	{
		int t;
		std::cin >> t;
		a.push_back(t);
	}
	std::sort(a.begin(), a.end());
	int maximum = 2*a[0];
	for (int i = 1; i < n; ++i)
	{
		int distance = a[i] - a[i-1];
		if (maximum < distance)
			maximum = distance;
	}
	{
		int distance = 2*(l-a[n-1]);
		if (maximum < distance)
			maximum = distance;
	}
#if 0
	std::cout << maximum/2 << (maximum % 2 ? ".5" : "") << '\n';
#else
	std::cout << std::scientific;
	std::cout << maximum/2. << '\n';
#endif
}


#include <algorithm>
#include <iostream>
#include <vector>

int main(void)
{
	int n, l;
	std::cin >> n >> l;

	std::vector<int> a;
	for (int i = 0; i < n; ++i)
	{
		int t;
		std::cin >> t;
		a.push_back(t);
	}
	std::sort(a.begin(), a.end());
	int maximum = 2*a[0];
	for (int i = 1; i < n; ++i)
	{
		int distance = a[i] - a[i-1];
		if (maximum < distance)
			maximum = distance;
	}
	{
		int distance = 2*(l-a[n-1]);
		if (maximum < distance)
			maximum = distance;
	}
	std::cout << maximum/2 << (maximum % 2 ? ".5" : "") << '\n';
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int minA(vector<int> a){
    int minA = a[0];
    for(int i = 1; i < a.size(); ++i)
        if(a[i] < minA ) minA = a[i];
    return minA;
}

int main()
{
    int n, l;
    cin >> n >> l;
    vector<int> a;
    for(int i = 0; i < n; ++i){
        int ai;
        cin >> ai;
        a.push_back(ai);
    }
    sort(a.begin(), a.end());
    int maxDistance = 0;
    for(int i = 0; i < a.size() - 1; ++i)
        maxDistance = abs(a[i + 1] - a[i]) > maxDistance ? abs(a[i + 1] - a[i]) : maxDistance;
    double radius = maxDistance > 2 * minA(a) ? maxDistance / 2 : minA(a);
    printf("%.9f", radius);
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

long long minA(vector<long long> a){
    long long minA = a[0];
    for(int i = 1; i < a.size(); ++i)
        if(a[i] < minA ) minA = a[i];
    return minA;
}

int main()
{
    int n, l;
    cin >> n >> l;
    vector<long long> a;
    for(int i = 0; i < n; ++i){
        long long ai;
        cin >> ai;
        a.push_back(ai);
    }
    sort(a.begin(), a.end());
    int maxDistance = 0;
    for(int i = 0; i < a.size() - 1; ++i)
        maxDistance = abs(a[i + 1] - a[i]) > maxDistance ? abs(a[i + 1] - a[i]) : maxDistance;
    long double radius = maxDistance > 2 * minA(a) ? maxDistance / 2 : minA(a);
    printf("%.10f", radius);
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    long long n, l;
    cin >> n >> l;
    vector<long long> a;
    for(int i = 0; i < n; ++i){
        long long ai;
        cin >> ai;
        a.push_back(ai);
    }
    sort(a.begin(), a.end());
    long double maxDistance = 0;
    long long minL = a[0];
    long long minR = l - a[0];

    for(int i = 1; i < a.size(); ++i){
        maxDistance = abs(a[i] - a[i - 1]) > maxDistance ? abs(a[i] - a[i - 1]) : maxDistance;
        minL = a[i] < minL ? a[i] : minL;
        minR = (l - a[i]) < minR ? (l - a[i]) : minR;
    }
    maxDistance /= 2;
    double radius = max(max(maxDistance, (long double)minL), (long double)minR);
    printf("%.10f", radius);

    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

int main() {
	int n, l;
	int a[1001];

	std::cin >> n >> l;

	for (int i = 0; i < n; i++) {
		std::cin >> a[i];
	}
	a[n] = n;

	std::sort(a, a+n+1);

	double d = a[0];
	for (int i = 0; i < n; i++) {
		double tmp = abs(a[i] - a[i+1]) / 2.0;
		std::cout << tmp << std::endl;
		if (tmp > d) d = tmp;
	}
	std::cout << d;
}


#include <iostream>
#include <algorithm>
#include <cmath>

int main() {
	int n, l;
	int a[1001];

	std::cin >> n >> l;

	for (int i = 0; i < n; i++) {
		std::cin >> a[i];
	}
	a[n] = n;

	std::sort(a, a+n+1);

	double d = a[0];
	for (int i = 0; i < n; i++) {
		double tmp = abs(a[i] - a[i+1]) / 2.0;
		if (tmp > d) d = tmp;
	}
	std::cout << std::fixed;
	std::cout << d;
}


#include <iostream>
#include <algorithm>
#include <cmath>

int main() {
	int n, l;
	int a[1001];

	std::cin >> n >> l;

	for (int i = 0; i < n; i++) {
		std::cin >> a[i];
	}
	a[n] = n;

	std::sort(a, a+n+1);

	double d = a[0];
	for (int i = 0; i < n; i++) {
		double tmp = abs(a[i] - a[i+1]) / 2.0;
		if (tmp > d) d = tmp;
	}
	std::cout << d;
}


#include <iostream>
#include <algorithm>
#include <cmath>

int main() {
	int n, l;
	int a[1001];

	std::cin >> n >> l;

	for (int i = 0; i < n; i++) {
		std::cin >> a[i];
	}

	std::sort(a, a+n);
	std::cout << std::fixed;

	double d = a[0];
	for (int i = 0; i < n-1; i++) {
		double tmp = (a[i+1] - a[i]) / 2.0;
		if (tmp > d) d = tmp;
	}
	double tmp = l - a[n-1];
	if (tmp > d) d = tmp;
	std::cout << d;
}


#include <iostream>
#include <algorithm>
#include <cmath>

int main() {
	int n, l;
	int a[1001];

	std::cin >> n >> l;

	for (int i = 0; i < n; i++) {
		std::cin >> a[i];
	}
	a[n] = l;

	std::sort(a, a+n+1);
	std::cout << std::fixed;

	double d = a[0];
	for (int i = 0; i < n; i++) {
		double tmp = abs(a[i] - a[i+1]) / 2.0;
		if (tmp > d) d = tmp;
	}
	std::cout << d;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tgmath.h>

using std::cin;   using std::cout;
using std::string;  using std::endl;
using std::vector;  using std::ceil;
using std::sort;    using std::max;

int main() {
    int n, l;
    cin >> n >> l;

    vector<long double> v;
    long double a;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        v.push_back(a);
    }

    sort(v.begin(), v.end());
    long double max_dist = 0;
    for (int i = 1; i < n; ++i) {
        max_dist = max(max_dist, v[i] - v[i-1]);
    }

    long double ret = max(max_dist / 2, v[0]-0);
    ret = max(ret, l - v[n - 1]);
    cout << ret;
    return 0;

}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tgmath.h>

using std::cin;   using std::cout;
using std::string;  using std::endl;
using std::vector;  using std::ceil;
using std::sort;    using std::max;

int main() {
    int n, l;
    cin >> n >> l;

    vector<double> v;
    double a;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        v.push_back(a);
    }

    sort(v.begin(), v.end());
    double max_dist = 0;
    for (int i = 1; i < n; ++i) {
        max_dist = max(max_dist, v[i] - v[i-1]);
    }

    double ret = max(max_dist / 2, v[0]-0);
    ret = max(ret, l - v[n - 1]);
    cout << ret;
    return 0;

}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tgmath.h>

using std::cin;   using std::cout;
using std::string;  using std::endl;
using std::vector;  using std::ceil;
using std::sort;    using std::max;

int main() {
    int n, l;
    cin >> n >> l;

    vector<long double> v;
    long double a;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        v.push_back(a);
    }

    sort(v.begin(), v.end());
    long double max_dist = 0;
    for (int i = 1; i < n; ++i) {
        max_dist = max(max_dist, v[i] - v[i-1]);
    }

    long double ret = max(max_dist / 2, v[0]-0);
    ret = max(ret, l - v[n - 1]);
    cout.precision(20);
    cout << ret;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int l,n;
    cin>>n>>l;
    int a[n+1];

    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    int maxi=0;
    maxi=2*a[1];
    for(int i=1;i<n;i++)
    {
        if((a[i+1]-a[i])>maxi)
            maxi=a[i+1]-a[i];
    }
    if(2*(l-a[n])>maxi)
        maxi=l-a[n+1];
    cout<<(float)maxi/2;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int l,n;
    cin>>n>>l;
    int a[n+1];

    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    int maxi=0;
    maxi=a[1];
    for(int i=1;i<n;i++)
    {
        if(a[i+1]-a[i]>maxi)
            maxi=a[i+1]-a[i];
    }
    if(l-a[n]>maxi)
        maxi=l-a[n+1];
    cout<<(float)maxi/2;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int l,n;
    cin>>n>>l;
    int a[n+1];

    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    int maxi=0;
    maxi=2*a[1];
    for(int i=1;i<n;i++)
    {
        if((a[i+1]-a[i])>maxi)
            maxi=a[i+1]-a[i];
    }
    if(2*(l-a[n])>maxi)
        maxi=2*(l-a[n]);
    cout<<maxi/2<<(maxi%2!=0 ?".5":"");
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int l,n;
    cin>>n>>l;
    int a[n+1];

    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    int maxi=0;
    maxi=a[1];
    for(int i=1;i<n;i++)
    {
        if(a[i+1]-a[i]>maxi)
            maxi=a[i+1]-a[i];
    }
    if(l-a[n+1]>maxi)
        maxi=l-a[n+1];
    cout<<(float)maxi/2;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int l,n;
    cin>>n>>l;
    int a[n+1];

    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    int maxi=0;
    maxi=2*a[1];
    for(int i=1;i<n;i++)
    {
        if((a[i+1]-a[i])>maxi)
            maxi=a[i+1]-a[i];
    }
    if(2*(l-a[n])>maxi)
        maxi=l-a[n+1];
    cout<<maxi/2<<(maxi%2!=0 ?".5":"");
    return 0;

}


#include <stdio.h>
#include <algorithm>
using namespace std;
int n,i,a[100500],rez,l;
int main()
{
    scanf("%d%d",&n,&l);
    for (i = 0; i < n; i++)
        scanf("%d",&a[i]);
    sort(a,a+n);
    rez = 2*max(a[0],l-a[n-1]);
    for (i = 0; i < n-1; i++)
        rez = max(rez, a[i+1]-a[i]);
    printf("%.10f\n",rez/2.);
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    long long int n,l,d;
    cin >> n >> l;
     long long big = 0;

    int pos[n];

    for (int i = 0; i < n; i++){
        cin >> pos[i];
    }
    sort (pos, pos + n);

    for (int i = 1; i < n; i++){
        d= pos[i] - pos[i-1];
        big = max(big,d);
    }
    d =  2 * pos[0];
    big = max(d, big);

    d = 2 * (l - pos[n-1]);
    big = max(d,big);

    if ( big % 2 == 0){
    cout << big/2;}
    else cout << big/2 << ".5" << endl;
}


#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    long long int n,l;
    long double big,d;
    cin >> n >> l;

    int pos[n];

    for (int i = 0; i < n; i++){
        cin >> pos[i];
    }
    sort (pos, pos + n);

    for (int i = 1; i < n; i++){
        d= pos[i] - pos[i-1];
        big = max(big,d);
    }
    d = pos[0];
    big = max (d, big/2);

    d = l - pos[n-1];
    big = max(d,big);

    cout << big;
}


#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    int n,l;
    double big,d;
    cin >> n >> l;

    int pos[n+1];

    for (int i = 0; i < n; i++){
        cin >> pos[i];
    }
    sort (pos, pos + n);

    for (int i = 1; i < n; i++){
        d= pos[i] - pos[i-1];
        big = max(big,d);
    }
    d = pos[0];
    big = max (d, big/2);

    d = l - pos[n-1];
    big = max(d,big);

    cout << big;
}


#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
    int n,l;
    cin>>n>>l;
    vector<double> arr;
    int c;
    for (int i=0; i<n; i++) {
        cin>>c;
        arr.push_back(c);
    }
    sort(arr.begin(), arr.end());
    double maxdist=0;
    for (int i=1; i<n; i++) {
        maxdist = max(maxdist,arr[i]-arr[i-1]);
    }
    printf("%.10f",max(maxdist/2,max(arr[0],l-arr[n-1])));
}


#include <bits/stdc++.h>
using namespace std;
int a[1006];
int main(void)
{
    int n, l;
    cin>>n>l;
    for(int i=0; i<n; i++){
        cin>>a[i];
    }
    double mx= 0, temp;
    sort(a, a+n);
    for(int i= 1; i<n; i++){
        temp= abs(a[i]-a[i-1]);
        if(mx < temp) mx= temp;
    }
    mx = (double)mx/2;
    mx= fmax(mx, a[0]);
    mx= fmax(mx, abs(a[n-1] - l) );
    cout<<fixed;
    cout.precision(9);
    cout<< mx <<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,l,i,maxx=0;
    double x,y,z,ans;
    scanf("%lld%lld",&n,&l);
    long long int a[n];
    for(i=0; i<n; i++)
    {
        scanf("%lld",&a[i]);
    }
    sort(a,a+n);
    for(i=0; i<n-1; i++)
    {
        if(a[i+1]-a[i]>maxx)
           maxx=a[i+1]-a[i];
    }
    x=maxx/2.0;
    y=a[0]-0.0;
    z=(double)l-a[n-1];
    ans=max(y,z);
    ans=max(ans,x);
    printf("%.10f\n",ans);
    return 0;
}


var input = readline(), n = +input[0], l = +input[1],
a = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1, x;

for(i = 1; i < n; i++){
	x = a[i] - a[i-1];
	max = (x > max) ? x : max;
}

max = Math.max(max/2, Math.max((l - a[n-1]), a[0]));

write(max.toFixed(10));


var input = readline().split(" "), n = +input[0], l = +input[1],
a = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1, x;

for(i = 1; i < n; i++){
	x = a[i] - a[i-1];
	max = (x > max) ? x : max;
}

x = Math.max(max/2, Math.max((l - a[n-1]), (a[0] - 0)));

write(x.toFixed(10));


var inp = readline().split(" ").map(function(x){return parseInt(x);});
var n = inp[0];
var l = inp[1];

var a = readline().split(" ").map(function(x){return parseInt(x);});
a.sort(function(e,x){return e > x;});
if (a[0] != 0){
	a.unshift(-a[0]);
	n++;
}
if (a[n-1] != l){
	a.push(l + (l-a[n-1]));
	n++;
}
var max = 0;
var dif = max;
for(var i=1; i < n; i++){
	dif =  a[i] - a[i-1];
	if (dif > 0 && dif > max) max = dif;
}

print(max/2);


var inp = readline().split(" ").map(function(x){return parseInt(x);});
var n = inp[0];
var l = inp[1];

var a = readline().split(" ").map(function(x){return parseInt(x);});

a.sort(function(e,x){return e - x;});
if (a[0] != 0){
	a.unshift(-a[0]);
	n++;
}
if (a[n-1] != l){
	a.push(l + (l-a[n-1]));
	n++;
}
var max = 0;
var dif = max;
for(var i=1; i < n; i++){
	dif =  a[i] - a[i-1];
	if (dif > max) max = dif;
}

print(max/2);


if (undefined == readline) {
	readline = function() {

	}
}

var ints = function() {
	return readline().split(' ').map(function(w) {
		return parseInt(w)
	})
}

var minus = function(a, b) {
    return a - b
}

var numbers = ints()
	n = numbers[0],
	l = numbers[1]
numbers = ints()
numbers.sort(minus)

var k = numbers.length - 1,
	distance = Math.max(2 * numbers[0], 2 * (l - numbers[numbers.length - 1]))

while (k > 0) {
	distance = Math.max(distance, numbers[k] - numbers[k - 1])
	k --
}

print((distance / 2).toFixed(9))


var n, l, max = 0.0;
var input = readline();
n = Number(input.split(" ")[0]);
l = Number(input.split(" ")[1]);

var lanterns = new Array(n);
input = readline();

for (var i = 0; i < lanterns.length; i++) {
  lanterns[i] = Number(input.split(" ")[i]);
}

for (var i = 0; i < lanterns.length - 1; i++) {
  for (var j = i + 1; j < lanterns.length; j++) {
    if (lanterns[i] > lanterns[j]) {
      var tmp = lanterns[i];
      lanterns[i] = lanterns[j];
      lanterns[j] = tmp;
    }
  }
} // sorting

for (var i = 0; i < lanterns.length - 1; i++) {
   var difference = lanterns[i + 1] - lanterns[i];
   if (difference > max) {
     max = difference;
   }
}
max /= 2;
var first = lanterns[0] - 0;
var last = l - lanterns[n - 1];

if (first > max) {
  max = first;
}
if (last > max) {
  max = last;
}

write(max);


var ints = function() {
	return readline().split(' ').map(function(w) {
		return parseInt(w)
	})
}

var minus = function(a, b) {
    return a - b
}

var numbers = ints()
	n = numbers[0],
	l = numbers[1]
numbers = ints()
numbers.sort(minus)

var result = numbers.reduce(function(current, position) {
	current.max = Math.max(current.max, position - current.position)
	current.position = position
	return current
}, {
	max: 0,
	position: 0
})

print((result.max / 2).toFixed(9))


var input = readline().trim().split(' ').map((x)=>parseInt(x));
var a = readline().trim().split(' ').map((x)=>parseInt(x));

a.sort((a,b)=>a-b);

var b =[];
for (var i = 0; i < a.length-1; i++) {
	b.push(a[i+1]-a[i]);
}

b.sort((a,b)=>b-a)
print(Math.max((b[0]*1.0)/2,a[0],input[1]-a[a.length-1]));


var input = readline().trim().split(' ').map((x)=>parseInt(x));
var a = readline().trim().split(' ').map((x)=>parseInt(x));

if(input[0]==1)
    print(Math.max(a[0],input[1]-a[0]));
else{
    a.sort((a,b)=>a-b);

    var b =[];
    for (var i = 0; i < a.length-1; i++) {
    	b.push(a[i+1]-a[i]);
    }

    b.sort((a,b)=>b-a)
    print(Math.max((b[0]*1.0)/2,a[0],input[1]-a[a.length-1]));
}


var s = readline().split(" ");
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(" ").map(Number).sort((a, b) => a-b);

var maxDif = Math.max(s[0] * 2, (l - s[n-1]) * 2);
for(var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i-1]);
}

print(maxDif / 2);


var s = readline().split(' ');
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(' ').map(el => parseInt(el)).sort((a, b) => a - b)
var maxDif = Math.max(s[0] * 2, (l - s[n - 1] * 2));
for (var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i - 1]);
}
print(maxDif / 2);


var s = readline().split(' ');
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(' ').map(Number).sort((a, b) => a - b)
var maxDif = Math.max(s[0] * 2, (l - s[n - 1]) * 2);
for (var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i - 1]);
}
print(maxDif / 2);


var s = readline().split(' ');
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(' ').map(Number).sort((a, b) => a - b)
var maxDif = Math.max(s[0] * 2, (l - s[n - 1] * 2));
for (var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i - 1]);
}
print(maxDif / 2);


var s = readline().split(' ');
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(' ').map(el => parseFloat(el)).sort((a, b) => a - b)
var maxDif = Math.max(s[0] * 2, (l - s[n - 1] * 2));
for (var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i - 1]);
}
print(maxDif / 2);


'use strict'

String.prototype.getNumArray = function () {
  return String(this).split(' ').map(function (value) {
    return parseInt(value);
  });
}

let _arr = readline().getNumArray(),
    n = _arr[0],
    l = _arr[1],
    array = readline().getNumArray(),
    maxDistance = 0;

array.sort(function(a, b) {
  return a - b;
});

for(let i = 1; i < array.length; i++) {
  if(array[i] - array[i - 1] > maxDistance) {
    maxDistance = array[i] - array[i - 1];
  }
}

if (array[0] > maxDistance / 2 || l - array[array.length - 1] > maxDistance / 2) {
  if(array[0] > l - array[array.length - 1]) {
    maxDistance = array[0];
  } else {
    maxDistance = l - array[array.length - 1];
  }
} else {
  maxDistance = maxDistance / 2;
}
write(maxDistance);


'use strict'

String.prototype.getNumArray = function () {
  return String(this).split(' ').map(function (value) {
    return parseInt(value);
  });
}

let _arr = readline().getNumArray(),
    n = _arr[0],
    l = _arr[1],
    array = readline().getNumArray(),
    maxDistance = 0;

array.sort(function(a, b) {
  return a - b;
});

for(let i = 1; i < array.length; i++) {
  if(array[i] - array[i - 1] > maxDistance) {
    maxDistance = array[i] - array[i - 1];
  }
}

if (array[0] > maxDistance / 2 || l - array[array.length - 1] > maxDistance / 2) {
  if(array[0] > maxDistance / 2) {
    maxDistance =array[0];
  } else {
    maxDistance = l - array[array.length - 1];
  }
} else {
  maxDistance = maxDistance / 2;
}
write(maxDistance);


'use strict'

String.prototype.getNumArray = function () {
  return String(this).split(' ').map(function (value) {
    return parseInt(value);
  });
}

let _arr = readline().getNumArray(),
    n = _arr[0],
    l = _arr[1],
    array = readline().getNumArray(),
    maxDistance = 0;

array.push(0);
array.push(l);

array.sort(function(a, b) {
  return a - b;
});

for(let i = 1; i < array.length; i++) {
  if(array[i] - array[i - 1] > maxDistance) {
    maxDistance = array[i] - array[i - 1];
  }
}

write(maxDistance / 2);


var f = readline().split(" ");
var str = readline().split(" ").sort((x,y)=>x-y);
var res = Math.min.apply(this, str);
	for (var i=0; i<+f[0]; i++){
			if (Number(str[i+1])-Number(str[i])>res)
				res = +str[i+1]-Number(str[i]);

	}
	print(Math.min.apply(this, str)!=0? Math.min.apply(this, str): res/2);


var f = readline().split(" ");
var str = readline().split(" ").sort((x,y)=>x-y);
var res = Math.max(+str[0] * 2, (+f[1] - str[+f[0]-1]) * 2);
	for (var i=0; i<+f[0]; i++){
			if (Number(str[i+1])-Number(str[i])>res)
				res = +str[i+1]-Number(str[i]);

	}
	print(res/2);


var f = readline().split(" ");
var str = readline().split(" ").sort((x,y)=>x-y);
var res = 0;
	for (var i=0; i<+f[0]; i++){
			if (Number(str[i+1])-Number(str[i])>res)
				res = +str[i+1]-Number(str[i]);

	}
	print(res/2>=Math.min.apply(this, str)? res/2:Math.min.apply(this, str));


var main = function(nPositions, l)
{
	var max = 0;
	var increase = function(a, b)
	{
		return +a - +b;
	}
	var toAnArray = function(str)
	{
		str = str.split(' ');
		return str;
	}
	nPositions = toAnArray(nPositions);
	nPositions.sort(increase);
	for (var i = 1; i <= nPositions.length - 1; i++)
	{
		if (+nPositions[i] - +nPositions[i - 1] > max) max = +nPositions[i] - +nPositions[i - 1];
	}
	if (+nPositions[0] > max / 2) return (+nPositions[0]).toFixed(10);
	else if (l - +nPositions[nPositions.length - 1] > max / 2) return (l - +nPositioins[nPositions.length - 1]).toFixed(10);
	else return (max / 2).toFixed(10);

}

{
	var lAndN = readline(),
	nPositions = readline();
	lAndN = lAndN.split(' ');
	print(main(nPositions, +lAndN[1]));
}


var main = function(nPositions, l)
{
	var max = 0;
	var increase = function(a, b)
	{
		return +a - +b;
	}
	var toAnArray = function(str)
	{
		str = str.split(' ');
		return str;
	}
	nPositions = toAnArray(nPositions);
	nPositions.sort(increase);
	for (var i = 1; i <= nPositions.length - 1; i++)
	{
		if (+nPositions[i] - +nPositions[i - 1] > max) max = +nPositions[i] - +nPositions[i - 1];
	}
    if (((+nPositions[0] > max / 2) && (l - +nPositions[nPositions.length - 1] > max / 2)) && (+nPositions[0] > l - +nPositions[nPositions.length - 1] ) )return +nPositions[0];
		else if (((+nPositions[0] > max / 2) && (l - +nPositions[nPositions.length - 1] > max / 2)) && (+nPositions[0] < l - +nPositions[nPositions.length - 1] ) )return l - +nPositions[nPositions.length - 1];
		else if (+nPositions[0] > max / 2) return +nPositions[0];
		else if (l - +nPositions[nPositions.length - 1] > max / 2) return l - +nPositions[nPositions.length - 1];
		else return max / 2;

}

{
	var lAndN = readline(),
	nPositions = readline();
	lAndN = lAndN.split(' ');
	print(main(nPositions, +lAndN[1]));
}


var main = function(nPositions, l)
{
	var max = 0;
	var increase = function(a, b)
	{
		return +a - +b;
	}
	var toAnArray = function(str)
	{
		str = str.split(' ');
		return str;
	}
	nPositions = toAnArray(nPositions);
	nPositions.sort(increase);
	for (var i = 1; i <= nPositions.length - 1; i++)
	{
		if (+nPositions[i] - +nPositions[i - 1] > max) max = +nPositions[i] - +nPositions[i - 1];
	}
	if (((+nPositions[0] > max / 2) && (l - +nPositions[nPositions.length - 1] > max / 2)) && (+nPositions[0] > l - +nPositions[nPositions.length - 1] ) )return +nPositions[0];
		else if (((+nPositions[0] > max / 2) && (l - +nPositions[nPositions.length - 1] > max / 2)) && (+nPositions[0] < l - +nPositions[nPositions.length - 1] ) )return l - +nPositions[nPositions.length - 1];
		else if (+nPositions[0] > max / 2) return +nPositions[0];
		else if (l - +nPositions[nPositions.length - 1] > max / 2) return l - +nPositions[nPositions.length - 1] > max / 2;
		else return max / 2;

}

{
	var lAndN = readline(),
	nPositions = readline();
	lAndN = lAndN.split(' ');
	print(main(nPositions, +lAndN[1]));
}


var inp = readline().split(' ');
var a = readline().split(' ');

for(var i=0; i<inp.length; i++) {
    inp[i] = parseInt(inp[i], 10);
}
var n = inp[0], m = inp[1];

for(var i=0; i<a.length; i++) {
    a[i] = parseInt(a[i], 10);
}

a.sort((a,b) => a-b);

var max_d = -Infinity;

for(var i=0; i<a.length; i++) {
    if(i === 0 && a[i-1] !== 0) max_d = a[i];
    else if((a[i] - a[i-1])/2 > max_d) max_d = (a[i] - a[i-1])/2;
}

print(max_d);


var inp = readline().split(' ');
var a = readline().split(' ');

for(var i=0; i<inp.length; i++) {
    inp[i] = parseInt(inp[i], 10);
}
var n = inp[0], m = inp[1];

for(var i=0; i<a.length; i++) {
    a[i] = parseInt(a[i], 10);
}

a.sort((a,b) => a-b);

var max_d = -Infinity;

if(a[0] !== 0) max_d = a[0];
if(a[n-1] !== m && m - a[n-1] > max_d) max_d = m - a[n-1];

for(var i=0; i<a.length; i++) {
    if((a[i] - a[i-1])/2 > max_d) max_d = (a[i] - a[i-1])/2;
}

print(max_d);


(function main() {
    var line = readline().split(" "),
        n = line[0],
        l = line[1],
        aStrings = readline().split(" "),
        a = [],
        d,
        i;

    for (i in aStrings) {
        a[i] = +aStrings[i];
    }

    a.sort(function(a, b) {
        return a - b;
    });

    d = Math.max(a[0], l - a[a.length - 1]);

    for (i = 1; i < a.length; i++) {
        d = Math.max(d, (a[i] - a[i-1]) / 2);
    }

    print(d.toFixed(10));
})();


(function main() {
    var line = readline().split(" "),
        l = line[0],
        n = line[1],
        aStrings = readline().split(" "),
        a = [],
        d,
        i;

    for (i in aStrings) {
        a[i] = +aStrings[i];
    }

    a.sort(function(a, b) {
        return a - b;
    });

    d = Math.max(a[0], l - a[a.length - 1]);

    for (i = 1; i < a.length; i++) {
        d = Math.max(d, (a[i] - a[i-1]) / 2);
    }

    print(d.toFixed(10));
})();


var n = readline().split(' ');

var l = n[1];
n = n[0];

var a = readline().split(' ');
for (var i = 0; i < n; i++) {
    a[i] = parseInt(a[i])
}
a.sort(function (a, b) { return a - b });
var ans = Math.max(a[0], l - a[n - 1]);

for (var i = 0; i < n - 1; i++) {
    if ((a[i + 1] - a[i]) / 2 > ans) {
        ans = (a[i + 1] - a[i]) / 2;
        console.log("Ans:", ans)
    }
}

console.log(ans)
// console.log(l)


var n = readline().split(' ');

var l = n[1];
n = n[0];

var a = readline().split(' ');
for (var i = 0; i < n; i++) {
    a[i] = parseInt(a[i])
}
a.sort(function (a, b) { return a - b });
var ans = Math.max(a[0], l - a[n - 1]);

for (var i = 0; i < n - 1; i++) {
    if ((a[i + 1] - a[i]) / 2 > ans) {
        ans = (a[i + 1] - a[i]) / 2;
    }
}

write(ans)
// console.log(l)


var nums = readNums();

var n = nums[0];
var l = nums[1];

var lanterns = readNums();
lanterns.sort(function(a,b){return b-a});

var k = 0;

for (var i = 0; i<n ;i++) {
    var h = lanterns[i]-lanterns[i+1];
    if (h>k) {
        k = h;
    }
}

var r = k/2;

if (lanterns[n-1] > r) {
    r = lanterns[n-1];
}

if ((l-lanterns[0]) > r) {
    r = l-lanterns[0];
}

print(r);

function readNums() {
    return readline().split(' ').map(function(v) {
        return v - 0;
    })
}


'use strict';

// const rlLib = require('readline');

// const rl = rlLib.createInterface({
//   input: process.stdin,
//   output: process.stdout
// });

// let inputs = [];
// let allCount = 2;
// let currentLine = 0;

// rl.on('line', (input) => {
// 	inputs.push(input);
// 	if (inputs.length === allCount) {
// 		main();

// 		rl.close();
// 	}
// });

// function readline() {
// 	return inputs[currentLine++];
// }
// function print() {
// 	console.log.apply(this, arguments);
// }

// function main() {
	let rl = readline().split(' ').map(function(e) {return parseInt(e);});
	let f = readline().split(' ').map(function(e) {return parseInt(e, 10);});

	f = f.sort(function(a, b) {return a - b;});

	if (f[f.length - 1] !== rl[1]) {
		f.push(rl[1] * 2);
	}

	let res = f[0] * 2;

	f.forEach(function(e, i) {
		if (i+1 < f.length && (f[i+1] - f[i]) > res) {
			res = f[i+1] - f[i];
		}
	});

	print(res / 2);
// }


'use strict';

// const rlLib = require('readline');

// const rl = rlLib.createInterface({
//   input: process.stdin,
//   output: process.stdout
// });

// let inputs = [];
// let allCount = 2;
// let currentLine = 0;

// rl.on('line', (input) => {
// 	inputs.push(input);
// 	if (inputs.length === allCount) {
// 		main();

// 		rl.close();
// 	}
// });

// function readline() {
// 	return inputs[currentLine++];
// }
// function print() {
// 	console.log.apply(this, arguments);
// }

// function main() {
	let rl = readline().split(' ').map(function(e) {return parseInt(e);});
	let f = readline().split(' ').map(function(e) {return parseInt(e, 10);});

	f = f.sort(function(a, b) {return a - b;});

	let res = f[0] * 2;

	if (f[f.length - 1] < rl[1]) {
		let r = (rl[1] - f[f.length - 1])*2;
		res = res > r ? res : r;
	}

	f.forEach(function(e, i) {
		if (i+1 < f.length && (f[i+1] - f[i]) > res) {
			res = f[i+1] - f[i];
		}
	});

	print(res / 2);
// }


// 'use strict';

// const rlLib = require('readline');

// const rl = rlLib.createInterface({
//   input: process.stdin,
//   output: process.stdout
// });

// let inputs = [];
// let allCount = 2;
// let currentLine = 0;

// rl.on('line', (input) => {
// 	inputs.push(input);
// 	if (inputs.length === allCount) {
// 		main();

// 		rl.close();
// 	}
// });

// function readline() {
// 	return inputs[currentLine++];
// }
// function print() {
// 	console.log.apply(this, arguments);
// }

// function main() {
	let rl = readline().split(' ').map(function(e) {return parseInt(e);});
	let f = readline().split(' ').map(function(e) {return parseInt(e, 10);});

	f = f.sort(function(a, b) {return a - b;});

	let res = f[0] * 2;

	if (f[f.length - 1] < rl[1]) {
		let r = (rl[1] - f[f.length - 1])*2;
		res = res > r ? res : r;
	}

	f.forEach(function(e, i) {
		if (i+1 < f.length && (f[i+1] - f[i]) > res) {
			res = f[i+1] - f[i];
		}
	});

	print(res / 2);
// }


"use strict";

var input = readline().split(' ').map(value => +value);
var n = input[0];
var l = 2 * input[1];
var a = readline().split(' ').map(value => 2 * value).sort((a, b) => a - b);

var f = function (x) {
    var right = 0;

    for (let i = 0; i < n; ++i) {
        if (right < a[i] - x) {
            return false;
        }

        right = a[i] + x;
    }

    return right >= l;
};

var left = 0;
var right = l;

while (right - left > 1) {
    var m = Math.floor((left + right) / 2);

    if (f(m)) {
        right = m;
    } else {
        left = m;
    }
}

write(right / 2);


X=readline().split(' ').map(Number)
n=X[0],l=X[1]
A=readline().split(' ').map(Number)
A=A.sort((x,y)=>x-y).reduce((a,c)=>a.length?(a[a.length-1]!=c?a.concat(c):a):[c],[])

A=A.map((x,i) =>
    Math.max(i==0 ? x : (A[i-1]-x)/2, (i==A.length-1) ? l-x : (A[i+1]-x)/2))

print(Math.max.apply(null, A))


function main() {
  var counters = readline().trim().split(' ').map(string => parseInt(string, 10));
  var lanternsCount = counters[0];
  var streetLength = counters[1];
  var lanternsLocation = readline().trim().split(' ').map(string => parseInt(string));

  lanternsLocation = lanternsLocation.sort((a, b) => a - b);

  var min_radius = 0.0000000000;
  for (var index = 0; index < lanternsLocation.length - 1; index++) {
    var curr_radius = (lanternsLocation[index + 1] - lanternsLocation[index]) / 2.0000000000;
    min_radius = Math.max(min_radius, curr_radius);
  }

  if (!lanternsLocation.includes(0)) {
    min_radius = Math.max(min_radius, lanternsLocation[0]);
  }

  if (!lanternsLocation.includes(streetLength)) {
    min_radius = Math.max(min_radius, streetLength - lanternsLocation[lanternsLocation.length - 1]);
  }

  print(min_radius);
}

main();


function main() {
  var [lanternsCount, streetLength] = readline().trim().split(' ').map(string => parseInt(string, 10));
  var lanternsLocation = readline().trim().split(' ').map(string => parseInt(string));

  lanternsLocation = lanternsLocation.sort((a, b) => a - b);

  var min_radius = 0.0000000000;
  for (var index = 0; index < lanternsLocation.length - 1; index++) {
    var curr_radius = (lanternsLocation[index + 1] - lanternsLocation[index]) / 2.0000000000;
    min_radius = Math.max(min_radius, curr_radius);
  }

  if (!lanternsLocation.includes(0)) {
    min_radius = Math.max(min_radius, lanternsLocation[0]);
  }

  if (!lanternsLocation.includes(streetLength)) {
    min_radius = Math.max(min_radius, streetLength - lanternsLocation[lanternsLocation.length - 1]);
  }

  print(min_radius);
}

main();


// var _i = 0;
//
// function readline() {
//     _i ++;
//
//     switch (_i) {
//         // case 1: return '2 5';
//         // case 2: return '2 5';
//         case 1: return '7 15';
//         case 2: return '15 5 3 7 9 14 0';
//     }
// }
//
// function write(value) {
//     console.log(value);
// }

function f(d) {
    if (d < a[0] || a[a.length-1] + d < l) {
        return false;
    }

    for (var i = 1; i < a.length; i ++) {
        if (a[i-1] + d < a[i] - d) {
            return false;
        }
    }
    return true;
}

var [n, l] = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

var a = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

a.sort(function(x, y) {
    return x - y;
});

var x = 0;
var y = l;
var m;
var EPS = 10e-11;

while (Math.abs(x - y) > EPS) {
    m = (x + y) / 2;
    if (f(m)) {
        y = m;
    } else {
        x = m;
    }
}

write(m);


// var _i = 0;
//
// function readline() {
//     _i ++;
//
//     switch (_i) {
//         case 1: return '2 1000000000';
//         case 2: return '0 1000000000';
//     }
// }
//
// function write(value) {
//     console.log(value);
// }

function f(d) {
    if (d < a[0] || a[a.length-1] + d < l) {
        return false;
    }

    for (var i = 1; i < a.length; i ++) {
        if (a[i-1] + d < a[i] - d) {
            return false;
        }
    }

    return true;
}

var list = readline().split(' ');

var n = parseInt(list[0]);
var l = parseInt(list[1]);

var a = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

a.sort(function(x, y) {
    return x - y;
});

var x = 0;
var y = l;
var m;

var EPS = 10e-6;

while (Math.abs(x - y) > EPS) {
    m = (x + y) / 2;
    if (f(m)) {
        y = m;
    } else {
        x = m;
    }
}

write(m);


// var _i = 0;
//
// function readline() {
//     _i ++;
//
//     switch (_i) {
//         // case 1: return '2 5';
//         // case 2: return '2 5';
//         case 1: return '7 15';
//         case 2: return '15 5 3 7 9 14 0';
//     }
// }
//
// function write(value) {
//     console.log(value);
// }

function f(d) {
    if (d < a[0] || a[a.length-1] + d < l) {
        return false;
    }

    for (var i = 1; i < a.length; i ++) {
        if (a[i-1] + d < a[i] - d) {
            return false;
        }
    }
    return true;
}

var list = readline().split(' ');

var n = parseInt(list[0]);
var l = parseInt(list[1]);

var a = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

a.sort(function(x, y) {
    return x - y;
});

var x = 0;
var y = l;
var m;
var EPS = 10e-11;

while (Math.abs(x - y) > EPS) {
    m = (x + y) / 2;
    if (f(m)) {
        y = m;
    } else {
        x = m;
    }
}

write(m);


// var _i = 0;
//
// function readline() {
//     _i ++;
//
//     switch (_i) {
//         case 1: return '2 1000000000';
//         case 2: return '0 1000000000';
//     }
// }
//
// function write(value) {
//     console.log(value);
// }

var list = readline().split(' ');

var n = parseInt(list[0]);
var l = parseInt(list[1]);

var a = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

a.sort(function(x, y) {
    return x - y;
});

var ans = Math.max(a[0], l - a[a.length - 1]);

for (var i = 1; i < a.length; i ++) {
    ans = Math.max(ans, (a[i] - a[i-1]) / 2);
}

write(ans);


// var _i = 0;
//
// function readline() {
//     _i ++;
//
//     switch (_i) {
//         case 1: return '2 5';
//         case 2: return '2 5';
//     }
// }
//
// function write(value) {
//     console.log(value);
// }

function f(d) {
    if (d < a[0] || a[a.length-1] + d < l) {
        return false;
    }

    for (var i = 1; i < a.length; i ++) {
        if (a[i-1] + d < a[i] - d) {
            return false;
        }
    }

    return true;
}

var list = readline().split(' ');

var n = parseInt(list[0]);
var l = parseInt(list[1]);

var a = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

a.sort(function(x, y) {
    return x - y;
});

var x = 0;
var y = l;
var m;

var EPS = 10e-9;

while (Math.abs(x - y) > EPS) {
    m = (x + y) / 2;
    if (f(m)) {
        y = m;
    } else {
        x = m;
    }
}

write(m);


var tokens = readline().split(" ");
var n = +tokens[0];
var l = +tokens[1];
var array = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1;
for(var i = 1; i < n; i++){
    var value = array[1] - array[0];
    max = max > value ? max : value;
}
var res = Math.max(max/2,array[0] - 0, l - array[n-1] );
write(x);


var tokens = readline().split(" ");
var n = +tokens[0];
var l = +tokens[1];
var array = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1;
for(var i = 1; i < n; i++){
    var value = array[1] - array[0];
    max = max > value ? max : value;
}
var res = Math.max(max/2,array[0] - 0, l - array[n-1] );
write(res);


var tokens = readline().split(" ");
var n = +tokens[0];
var l = +tokens[1];
var array = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1;
for(var i = 1; i < n; i++){
    var value = array[i] - array[i-1];
    max = max > value ? max : value;
}
var res = Math.max(max/2,array[0] - 0, l - array[n-1] );
write(res);


var tokens = readline().split(" ");
var n = +tokens[0];
var m = +tokens[1];
var array = readLine().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1;
for(var i = 1; i < n; i++){
    var value = array[1] - array[0];
    max = max > value ? max : value;
}
var res = Math.max(max/2,array[0] - 0, l - array[n-1] );
write(x);


var tokens = readline().split(" ");
var n = +tokens[0];
var m = +tokens[1];
var array = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1;
for(var i = 1; i < n; i++){
    var value = array[1] - array[0];
    max = max > value ? max : value;
}
var res = Math.max(max/2,array[0] - 0, l - array[n-1] );
write(x);


var tokens = readLine().split(" ");
var n = +tokens[0];
var m = +tokens[1];
var array = readLine().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1;
for(var i = 1; i < n; i++){
    var value = array[1] - array[0];
    max = max > value ? max : value;
}
var res = Math.max(max/2,array[0] - 0, l - array[n-1] );
write(x);


var input = readline().split(' ').map(x => parseInt(x));
var n = input[0], l = input[1];
var sorted = readline().split(' ').map(x => parseInt(x)).sort((a,b) => a-b);
var difference = -Infinity;
for (var i = 1; i < sorted.length; i++) difference = Math.max(difference, sorted[i] - sorted[i-1]);
difference /= 2;
if (sorted[0] !== 0) difference = Math.max(sorted[0], difference);
if (sorted[n-1] !== l) difference = Math.max(difference, l - sorted[n-1]);
print(difference);


var input = readline().split(' ').map(x => parseInt(x));
var n = input[0], l = input[1];
var sorted = readline().split(' ').map(x => parseInt(x)).sort((a,b) => a-b);
var difference = -Infinity;
for (var i = 1; i < sorted.length; i++) difference = Math.max(difference, a[i] - a[i-1]);
difference /= 2;
if (sorted[0] !== 0) difference = Math.max(sorted[0], difference);
if (sorted[n-1] !== l) difference = Math.max(difference, l - sorted[n-1]);
print(difference);


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int ar[n];
    vector<int>dido;
    int x = 0;;
    for(int i = 0 ; i < n ; i++)
    {
        cin>>ar[i];
    }
    for(int i = 0 ; i < n ; i++)
    {
        if(ar[i]>0&&ar[i]<=n)
        {
            bool v;
            for(int j = 0 ; j < dido.size() ; j++)
            {
                if(ar[i]==dido[j])
                {
                   x++;
                   v=true;
                }
            }
            if(v==false) dido.push_back(ar[i]);
        }
       // else x++;
    }
    cout<<x<<endl;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int ar[n];
    vector<int>dido;
    int answer = 0;
    for(int i = 0 ; i < n ; i++)
    {
        cin>>ar[i];
    }
    for(int i = 0 ; i < n ; i++)
    {
        if(ar[i]>0&&ar[i]<=n)
        {
            bool v;
            for(int j = 0 ; j < dido.size() ; j++)
            {
                if(ar[i]==dido[j])
                {
                   answer++;
                   v=true;
                }
            }
            if(v==false) dido.push_back(ar[i]);
        }
        else answer++;
    }
    cout<<answer<<endl;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int ar[n];
    vector<int>dido;
    int x = 0;;
    for(int i = 0 ; i < n ; i++)
    {
        cin>>ar[i];
    }
    for(int i = 0 ; i < n ; i++)
    {
        if(ar[i]>0&&ar[i]<=n)
        {
            bool q=false;
            for(int j = 0 ; j < dido.size() ; j++)
            {
                if(ar[i]==dido[j])
                {
                   x++;
                   q=true;
                   break;
                }
            }
            if(q==false) dido.push_back(ar[i]);
        }
        else x++;
    }
    cout<<x<<endl;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int ar[n];
    vector<int>dido;
    int x = 0;;
    for(int i = 0 ; i < n ; i++)
    {
        cin>>ar[i];
    }
    for(int i = 0 ; i < n ; i++)
    {
        if(ar[i]>0&&ar[i]<=n)
        {
            bool v;
            for(int j = 0 ; j < dido.size() ; j++)
            {
                if(ar[i]==dido[j])
                {
                   x++;
                   v=true;
                }
            }
            if(v==false) dido.push_back(ar[i]);
        }
        else x++;
    }
    cout<<x<<endl;
}


#include<bits/stdc++.h>
using namespace std;
//KASRA FOULADI;
bool b[5002];
int main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int n, num, ans;
    cin >> n;
    ans = n;
    for(int i = 0; i < n; ++i){
        cin >> num;
        --num;
        if(!b[num] &&  n < num){
            b[num] = true;
            --ans;
        }
    }
    cout << ans << '\n';

}


#include<bits/stdc++.h>
using namespace std;
//KASRA FOULADI;
bool b[5002];
int main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int n, num, ans;
    cin >> n;
    ans = n;
    for(int i = 0; i < n; ++i){
        cin >> num;
        --num;
        if(!b[num] &&  num < n){
            b[num] = true;
            --ans;
        }
    }
    cout << ans << '\n';

}


#include<bits/stdc++.h>
using namespace std;
//KASRA FOULADI;
bool b[5002];
int main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int n, num, ans;
    cin >> n;
    ans = n;
    for(int i = 0; i < n; ++i){
        cin >> num;
        --num;
        if(!b[num]){
            b[num] = true;
            --ans;
        }
    }
    cout << ans << '\n';

}


#include <bits/stdc++.h>

using namespace std;

int main(){
	int n,c=0,num,a[5005];
	cin>>n;
	memset(a,0,sizeof a);
	for(int i=0;i<n;i++){
		cin>>num;
		a[num]++;
	}
	int l=0;
	for(int i=1;i<=n;i++){
		if (a[i]==0){
			l++;
		}
	}

	cout<< l;
	return 0;
}


//in the name of almighty Allah
//Nafis Jaman
//Bangladesh Army University of Engineering & Technology

#include<iostream>
#include<cstring>
using namespace std;

int main()
{
    int n,x,l=0;
    cin>>n;
    int a[n];
    memset(a,0,sizeof a);
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[x]=1;
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i] == 0)l++;
    }cout<<l;
}


//in the name of almighty Allah
//Nafis Jaman
//Bangladesh Army University of Engineering & Technology

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

int main()
{
    int n,x,l=0;
    cin>>n;
    int a[n+1];
    memset(a,0,sizeof a);
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[x]++;
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i] == 0)l++;
    }cout<<l;
    return 0;
}


//in the name of almighty Allah
//Nafis Jaman
//Bangladesh Army University of Engineering & Technology

#include<iostream>
#include<cstring>
using namespace std;

int main()
{
    int n,x,l=0;
    cin>>n;
    int a[n];
    memset(a,0,sizeof a);
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[x]=1;
    }
    for(int i=0;i<n;i++)
    {
        if(a[i] == 0)l++;
    }cout<<l;
}


//in the name of almighty Allah
//Nafis Jaman
//Bangladesh Army University of Engineering & Technology

#include<iostream>
#include<cstring>
using namespace std;

int main()
{
    int n,x,l=0;
    cin>>n;
    int a[n+1];
    memset(a,0,sizeof a);
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[x]++;
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i] == 0)l++;
    }cout<<l;
}


//in the name of almighty Allah
//Nafis Jaman
//Bangladesh Army University of Engineering & Technology

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

int main()
{
    int n,x,l=0,a[5005];
    cin>>n;
    memset(a,0,sizeof a);
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[x]++;
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i] == 0)l++;
    }cout<<l;
}


//in the name of almighty Allah
//Nafis Jaman
//Bangladesh Army University of Engineering & Technology

#include<iostream>
#include<cstring>
using namespace std;

int main()
{
    int n,x,l=0;
    cin>>n;
    int a[n+1];
    memset(a,0,sizeof a);
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[x]=1;
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i] == 0)l++;
    }cout<<l;
}


//in the name of almighty Allah
//Nafis Jaman
//Bangladesh Army University of Engineering & Technology

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

int main()
{
    int n,x,l=0;
    cin>>n;
    int a[n+1];
    memset(a,0,sizeof a);
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[x]++;
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i] == 0)l++;
    }cout<<l;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, j,cont;
    int matrix[5003];

    cin >> n;

    for (i=1;i<=n;i++)
        cin >> matrix[i];

    sort(matrix+1, matrix+n+1);

    for (i=1;i<=n;i++)
    {
        if (i != matrix[i])
            cont++;
    }

    cout << cont;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, j,cont=0;
    int matrix[5003], sin[5003];

    cin >> n;

    for (i=1;i<=n;i++)
    {
        cin >> matrix[i];
    }

    sort(matrix+1, matrix+n+1);

    unique(matrix+1, matrix+n+1);

    i=1;
    j=1;

    while (i < n)
    {
        if (matrix[j] == i)
            j++;
        else
            cont++;
        i++;
    }

    cout << cont;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, j,cont=0, max=0;
    int matrix[5003];

    cin >> n;

    for (i=1;i<=n;i++)
        cin >> matrix[i];

    sort(matrix+1, matrix+n+1);

    if (matrix[1] == 1)
        cont++;

    for (i=1;i<n;i++)
    {
        if (matrix[i] != matrix[i+1])
            cont++;
    }

    cout << n-cont;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, j,cont=0;
    int matrix[5003], sin[5003];

    cin >> n;

    for (i=1;i<=n;i++)
    {
        cin >> matrix[i];
    }

    sort(matrix+1, matrix+n+1);

    unique(matrix+1, matrix+n+1);

    i=1;
    j=1;

    while (i <= n)
    {
        if (matrix[j] == i)
            j++;
        else
            cont++;
        i++;
    }

    cout << cont;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, j,cont;
    int matrix[5003], sin[5003];

    cin >> n;

    for (i=1;i<=n;i++)
    {
        cin >> matrix[i];
    }

    sort(matrix+1, matrix+n+1);

    unique(matrix+1, matrix+n+1);

    i=1;
    j=1;

    while (i < n)
    {
        if (matrix[j] == i)
            j++;
        else
            cont++;
        i++;
    }

    cout << cont;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, j,cont=0, max=0,flap=0;
    int matrix[5003];

    cin >> n;

    for (i=1;i<=n;i++)
    {
        cin >> matrix[i];
        if (flap == 0)
        {
            if (matrix[i] <= n)
                flap =1;
        }
    }
    if (flap != 0)
        cont++;

    sort(matrix+1, matrix+n+1);

    for (i=1;i<n;i++)
    {
        if (matrix[i] != matrix[i+1])
            cont++;
    }

    cout << n-cont;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, j,cont = 0;
    int matrix[5003];

    cin >> n;

    for (i=1;i<=n;i++)
        cin >> matrix[i];

    sort(matrix+1, matrix+n+1);

    for (i=1;i<=n;i++)
    {
        if (i != matrix[i])
            cont++;
    }

    cout << cont;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, j,cont = 1, max=0;
    int matrix[5003];

    cin >> n;

    for (i=1;i<=n;i++)
        cin >> matrix[i];

    sort(matrix+1, matrix+n+1);

    for (i=1;i<n;i++)
    {
        if (matrix[i] != matrix[i+1])
            cont++;
    }

    cout << n-cont;

    return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int arr[5001];
int main(){
	int n;
	cin>>n;

	for(int i=0;i<n;i++) cin>>arr[i];
	sort(arr,arr+n);

	int total=0;
	for(int i=0;i<n;i++){
		if(arr[i]!=i+1){
			total ++;
		}
	}
	cout<<total;
}


#include<iostream>
#include<string.h>
using namespace std;
const int maxn=5001;
int vis[maxn];
int main(){
	int n;
	cin>>n;
	memset(vis,0,sizeof(vis));
	for(int i=0;i<n;i++){
		int m;
		cin>>m;
		vis[m]=1;
	}

	int count=0;
	for(int i=1;i<n+1;i++){
		if(!vis[i]) count++;
	}
	cout<<count<<endl;
}


#include<iostream>
#include<string.h>
using namespace std;
const int maxn=5e3+10;
int a[maxn];
bool vis[maxn];
int main(){
	int n;
	cin>>n;
	memset(vis,false,sizeof(vis));
	for(int i=1;i<=n;i++){
		cin>>a[i];
		vis[a[i]]=true;
	}

	int count=0;
	for(int i=1;i<n+1;i++){
		if(!vis[i]) count++;
	}
	cout<<count<<endl;
}


#include<iostream>
#include<string.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int arr[n+1];
	memset(arr,0,sizeof(arr));
	for(int i=0;i<n;i++){
		int m;
		cin>>m;
		arr[m]++;
	}

	int count=0;
	for(int i=1;i<n+1;i++){
		if(!arr[i]) count++;
		//cout<<arr[i]<<" ";
	}
	cout<<count<<endl;
}


#include<iostream>
#include<string.h>
using namespace std;
const int maxn=5001;
int a[maxn];
bool vis[maxn];
int main(){
	int n;
	cin>>n;
	memset(vis,false,sizeof(vis));
	for(int i=0;i<n;i++){
		cin>>a[i];
		vis[a[i]]=true;
	}

	int count=0;
	for(int i=1;i<n+1;i++){
		if(!vis[i]) count++;
	}
	cout<<count<<endl;
}


#include<iostream>
using namespace std;
int arr[5001];
int main(){
	int n;
	cin>>n;

	for(int i=0;i<n;i++){
		int num;
		cin>>num;
		arr[num]++;
	}
	int total=0;
	for(int i=0;i<5000;i++){
		if(arr[i]!=0){
			total += arr[i]-1;
		}
	}
	cout<<total;
}


#include<iostream>
#include<algorithm>
using namespace std;
int arr[5001];
int main(){
	int n;
	cin>>n;

	for(int i=0;i<n;i++) cin>>arr[i];
	sort(arr,arr+n);

	int total=0;
	for(int i=0;i<n;i++){
		if(arr[i]!=i){
			total ++;
		}
	}
	cout<<total;
}


#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int n,A[5005]={0},c=0,k;

cin>>n;
for(int i=0;i<n;i++)
{
   cin>>k;
   A[k]=A[k]+=1;
   if(A[k]>1 || k>n)
   c++;

}
cout<<c;
return 0;
}


#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int n,A[5000]={0},c=0,k;

cin>>n;
for(int i=0;i<n;i++)
{
   cin>>k;
   A[k]=A[k]+=1;
   if(A[k]>1 || A[k]>n)
   c++;

}
cout<<c;
return 0;
}


#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int n,A[5000]={0},c=0,k;

cin>>n;
for(int i=0;i<n;i++)
{
   cin>>k;
   A[k]=A[k]+=1;
   if(A[k]>1 || k>n)
   c++;

}
cout<<c;
return 0;
}


#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int n,A[5000]={0},c=0,k;

cin>>n;
for(int i=0;i<n;i++)
{
   cin>>k;
   A[k]=A[k]+=1;
   if(A[k]>1)
   c++;
   if(k>n)
   c++;
}
cout<<c;
return 0;
}


#include <cstdio>
#include <vector>
using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    vector<bool> numbers(n, false);
    for (int i = 0, a; i < n && scanf("%d", &a); ++i)
        numbers[a - 1] = true;

    int changes = 0;
    const int size = numbers.size();
    for (int i = 0; i < size; ++i)
        if (!numbers[i])
            ++changes;

    printf("%d\n", changes);
    return 0;
}
// 1459425739448


#include <cstdio>
#include <vector>
using namespace std;

typedef unsigned long long ull;

int main()
{
    ull n;
    scanf("%llu", &n);
    vector<bool> numbers(n, false);
    for (ull i = 0, a; i < n; ++i)
    {
        scanf("%llu", &a);
        numbers[a - 1] = true;
    }

    ull changes = 0;
    const ull size = numbers.size();
    for (ull i = 0; i < size; ++i)
        if (!numbers[i])
            ++changes;

    printf("%llu\n", changes);
    return 0;
}
// 1459427760096


#include <cstdio>
#include <vector>
using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    vector<int> numbers(n, 0);
    while (n-- > 0)
    {
        int i;
        scanf("%d", &i);
        ++numbers[i - 1];
    }

    int changes = 0;
    const auto size = numbers.size();
    for (int i = 0; i < size; ++i)
        if (numbers[i] == 0)
            ++changes;

    printf("%d\n", changes);
    return 0;
}
// 1459349589806


#include <iostream>

int a[5050];

int main() {
    int n;
    std::cin >> n;
    int ans = 0;
    for(int i = 1; i <= n; i++) {
        int t;
        std::cin >> t;
        a[t]++;
        if(t > n || a[t] >= 2) {
            ans++;
        }
    }
    std::cout << ans << '\n';
}
// 1520008112124


#include <stdio.h>
#include <cstring>

using namespace std;

int main(){
	int n, a, count;
	int numbers[5002];

	memset(numbers, 0, 5002 * sizeof(int));

	scanf("%d", &n);
	count = 0;
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &a);
		if (numbers[a] == 1){
			count++;
		} else{
			numbers[a] = 1;
		}
	}

	printf("%d", count);

	return 0;
}
// 1459344884072


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef unsigned long long ull;

int algs[10000];

int main() {
	int n, exc = 0;
	scanf("%d", &n);
	while(n--) {
		int a;
		scanf("%d", &a);
		if(algs[a-1]) {
			exc++;
		} else {
			algs[a-1]++;
		}
	}
	printf("%d\n", exc);

	return 0;
}
// 1520281399305


#include <bits/stdc++.h>

using namespace std;

int a[51111];

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  sort(a, a + n);
  if (a[0] > n) {
    cout << n << endl;
    return 0;
  }
  int ans = 1;
  int i = 1;
  while (i < n and a[i] <= n) {
    while (i < n and a[i] == a[i - 1]) i++;
    if (i < n and a[i] <= n) ans++;
    i++;
  }
  cout << n - ans << endl;
}

// 1520008231644


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, a, ans = 0, add = 0;
    cin >> n;
    vector<int> ch(n, 0);
    for(int i = 0; i < n; i++){
        cin >> a;
        if(a<=n){
        ch[a-1]++;
        }else{
            add++;
        }
    }
    for(int i = 0; i < n; i++){
        ans+=max(ch[i] - 1, 0);
    }
    ans+=add;
    if(ans == 0){
        if(ch[0]>0){
            cout << ans;
        }else{
            cout << n;
        }
    }else{
    cout << ans;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, a, ans = 0, add = 0;
    cin >> n;
    vector<int> ch(n, 0);
    for(int i = 0; i < n; i++){
        cin >> a;
        if(a<=n){
        ch[a-1]++;
        }else{
            add++;
        }
    }
    for(int i = 0; i < n; i++){
        ans+=max(ch[i] - 1, 0);
    }
    ans+=add;

    cout << ans;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, a, ans = 0;
    cin >> n;
    vector<int> ch(n, 0);
    for(int i = 0; i < n; i++){
        cin >> a;
        if(a<=n){
        ch[a-1]++;
        }
    }
    for(int i = 0; i < n; i++){
        ans+=max(ch[i] - 1, 0);
    }
    if(ans == 0){
        if(ch[0]>0){
            cout << ans;
        }else{
            cout << n;
        }
    }else{
    cout << ans;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, a, ans = 0;
    cin >> n;
    vector<int> ch(n, 0);
    for(int i = 0; i < n; i++){
        cin >> a;
        ch[a-1]++;
    }
    for(int i = 0; i < n; i++){
        ans+=max(ch[i] - 1, 0);
    }
    cout << ans;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std ;
int main()
{

int n , x = 0 ;

cin >> n ;

int* a = new int[n+1] ;

for (int i = 1 ; i <= n ; ++i) {
  cin >> a[i] ;
}

sort(a + 1 , a + n + 1) ;

for (int i = 1 ; i <= n ; ++i) {
  if (abs(i-a[i])) ++x ;
}

cout << x ;

}


#include <iostream>
#include <set>
using namespace std ;
int main()
{

int n ;
set<int> s ;

cin >> n ;

for (int i = 0 ; i < n ; ++i) {
  int x ;
  cin >> x ;
  if (x >= 1 && x <= n) s.insert(x) ;
}

cout << n-s.size() ;

}


#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std ;
int main()
{

int n , x = 0 ;

cin >> n ;

int* a = new int[n+1] ;

for (int i = 1 ; i <= n ; ++i) {
  cin >> a[i] ;
}

sort(a + 1 , a + n + 1) ;

for (int i = 1 ; i <= n ; ++i) {
  x += abs(i-a[i]) ;
}

cout << x ;

}


#include <iostream>
#include <vector>
using namespace std ;
int main()
{

vector<bool> v(5001) ;
int n , c = 0 ;

cin >> n ;

for (int i = 0 ; i < n ; ++i) {
  int x ;
  cin >> x ;
  v[x] = true ;
}

for (int i = 1 ; i <= n ; ++i) {
  if (v[i] == false) ++c ;
}

cout << c ;

}


#include <iostream>
#include <vector>
using namespace std ;
int main()
{

int n , s = 0 ;

cin >> n ;

vector<bool> v(n+1) ;

for (int i = 1 ; i <= n ; ++i) {
  int x ;
  cin >> x ;
  v[x] = true ;
}

for (int i = 1 ; i <= n ; ++i) {
  s += v[i] ;
}

cout << n-s ;

}


/*

                          *                     *
                           *   *           *   *
                            *        **       *
                             *     *    *    *
                              *             *
                          *    *           *    *
                      * * * * * * * * * * * * * * * *
                                 *       *
                                  *     *
                                   *   *
                                    * *
                                     *

    Listen! Don't you hear these mad symphonies of grievance and fear ?
    Melancholy and despair can be sensed when we draw near. Some hear a violin
    sound, others hear a man moaning in tears. These fields are haunted by
    nature's most sombre melodies. Suicidal white noise absorbing the essence
    from light, mirth and vitality.

*/
#include <bits/stdc++.h>
#define s scanf
#define p printf
#define pf push_front
#define pp push_back
#define mp make_pair
#define se second
#define fi first
#define OO 1e9
#define EPS 1e-9
#define __ 1000000007
#define V(a) vector <a>
#define P(a,b) pair <a,b>
#define II pair <int, int>
#define ALL(a) a.begin(),a.end()
#define mm(a) memset(a , -1 , sizeof a)
#define mm0(a) memset(a , 0 , sizeof a)
typedef unsigned long long int ull;
typedef long long int ll; using namespace std;
int OneD(int row, int col, int t_n_o_r) { return row * t_n_o_r + col; }
ll MOD(ll a, ll b) { return a >= 0 ? a % b : (b - abs(a % b)) % b; }
void MN(int &a, int b) { if (a > b) a = b; }
void MX(int &a, int b) { if (a < b) a = b; }
int X[] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int Y[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int main() { int n , cw = 0; s("%d", &n); V(int) seq(n + 1); seq[0] = -OO;
    for (int i = 1; i <= n; i++) s("%d", &seq[i]); sort(ALL(seq));
    for (int i = 1; i <= n; i++){
        if (seq[i] != i) cw++;
    } p("%d\n", cw);
    return 0;
}