#define _CRT_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <limits>
#include <sstream>
#include <vector>
#include <map>
#include<set>
#include <string>
#include<cstdlib>
#include <queue>
#include<iomanip>

using namespace std;

//#define int long long
#define fi(i, a, b) for(int i = (a); (i) < (b); (i)++)

const int N = 300005;

struct node{ int l, r; int num; int parent; int parentindex; vector<int> to; set<int> allowed; bool deleted; };
node a[N];
int n, m, p;
char s[N], c[N];
int cnt=1;

pair<int, int> goleft(int p){
	int parent = a[p].parent;
	set<int> :: iterator it = a[parent].allowed.find(a[p].parentindex);
	if (it == a[parent].allowed.begin()){
		return make_pair(parent, a[parent].l);
	}
	else{
		int e = a[parent].to[(*(--it))];
		return make_pair(e, a[e].r);
	}

}

pair<int,int> goright(int p){
	int parent = a[p].parent;
	int need = a[p].parentindex;
	set<int>::iterator it = a[parent].allowed.upper_bound(need);
	if (it == a[parent].allowed.end()){

		return make_pair(parent, a[parent].r);
	}
	else{
		return make_pair(a[parent].to[(*it)], a[a[parent].to[(*it)]].l);
	}
}

vector<char> ans;
void go(int p){
	for (set<int> ::iterator it = a[p].allowed.begin(); it != a[p].allowed.end(); ++it){
		ans.push_back('(');
		go(a[p].to[(*it)]);
		ans.push_back(')');
	}
}

void main()
{
#if defined(DEBUG) || defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%d%d%d", &n, &m, &p); p--;
	scanf("%s%s", &s, &c);
  int cur = 0;
  int first;
  fi(i, 0, n){
	  if (s[i] == '('){
		  a[cur].to.push_back(cnt);
		  a[cur].allowed.insert(a[cur].to.size() - 1);
		  a[cnt].num = cnt;
		  a[cnt].parent = cur;
		  a[cnt].parentindex = a[cur].to.size() - 1;
		  a[cnt].l = i;
		  cur = cnt;
		  if (i == p)
			  first = cur;
		  cnt++;

	  }
	  else{
		  a[cur].r = i;
		  if (i == p)
			  first = cur;
		  cur = a[cur].parent;
	  }
  }

   cur = first;
  int pos = p;
  fi(i, 0, m){
	  if (c[i] == 'L'){
		  if (pos == a[cur].l){
			  pair<int, int> q = goleft(cur);
				  cur = q.first; pos = q.second;
		  }
		  else{
			  if (a[cur].allowed.size() == 0){
				  pos = a[cur].l;
			  }
			  else{
				  cur = a[cur].to[*a[cur].allowed.rbegin()  ];
				  pos = a[cur].r;
			  }
		  }
	  }
	  else if (c[i] == 'R'){
		  if (pos == a[cur].r){
			  pair<int, int> q = goright(cur);
			  cur = q.first;
			  pos = q.second;

		  }
		  else{
			  if (a[cur].allowed.size() == 0){
				  pos = a[cur].r
					  ;
			  }
			  else{
				  cur = a[cur].to[*a[cur].allowed.begin()];
				  pos = a[cur].l;
			  }
		  }
	  }
	  else{
		  a[cur].deleted = true;
		  int par = a[cur].parent;
		  pair<int, int> q = goright(cur);
		  if (q.first == 0)
			  q = goleft(cur);
		  a[par].allowed.erase(a[cur].parentindex);
		  cur = q.first; pos = q.second;
		  //0
	  }
  }

  go(0);
  fi(i, 0, ans.size()){
	  printf("%c", ans[i]);
  }

}


#include <functional>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <utility>
#include <cstring>
#include <cstdlib>
#include <cstddef>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cctype>
#include <deque>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <unordered_map>

using namespace std;

#define mp make_pair
#define pb push_back
#define mref mem_fun_ref
#define bis back_inserter
#define all(x) (x).begin(), (x).end()

typedef long long int64;
typedef pair<int, int> pint;
typedef istringstream iss;
typedef ostringstream oss;

int main()
{
	//freopen("input.txt","r",stdin);

	/*12 5 3
	((()())(()))
	RRDLD*/

	int n, m, p;
	cin >> n >> m >> p;

	string s;
	cin >> s;

	list<int> mas;
	unordered_map<int, list<int>::iterator> place;

	int cur = 1;
	vector<int> wait;

	for (int i = 0; i < n; ++i)
	{
		if (s[i] == '(')
		{
			mas.push_back(cur);
			list<int>::iterator it = mas.end();
			--it;

			place[-cur] = it;
			wait.push_back(cur);
			++cur;
		}
		else
		{
			int close = wait.back();
			wait.pop_back();

			mas.push_back(-close);
			list<int>::iterator it = mas.end();
			--it;

			place[close] = it;
		}
	}

	list<int>::iterator it = mas.begin();
	for (int i = 1; i < p; ++i) ++it;

	string act;
	cin >> act;

	list<int>::iterator from;
	list<int>::iterator to;
	list<int>::iterator after;

	for (int i = 0; i < m; ++i)
	{
		if (act[i] == 'R') ++it;
		else if (act[i] == 'L') --it;
		else
		{

			if (*it < 0)
			{
				from = place[*it];
				to = place[-(*it)];
			}
			else
			{
				from = place[- (*it)];
				to = place[(*it)];
			}

			++to;
			after = to;

			mas.erase(from, to);

			it = after;
		}

		if (it == mas.end())
		{
			--it;
		}
	}

	for (list<int>::iterator it = mas.begin(); it != mas.end(); ++it)
	{
		if ((*it) > 0) putchar('(');
		else putchar(')');
	}

	cout << endl;

	return 0;
}


#include <functional>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <utility>
#include <cstring>
#include <cstdlib>
#include <cstddef>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cctype>
#include <deque>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <unordered_map>

using namespace std;

#define mp make_pair
#define pb push_back
#define mref mem_fun_ref
#define bis back_inserter
#define all(x) (x).begin(), (x).end()

typedef long long int64;
typedef pair<int, int> pint;
typedef istringstream iss;
typedef ostringstream oss;

int main()
{
	//freopen("input.txt","r",stdin);

	/*12 5 3
	((()())(()))
	RRDLD*/

	int n, m, p;
	cin >> n >> m >> p;

	string s;
	cin >> s;

	list<int> mas;
map<int, list<int>::iterator> place;

	int cur = 1;
	vector<int> wait;

	for (int i = 0; i < n; ++i)
	{
		if (s[i] == '(')
		{
			mas.push_back(cur);
			list<int>::iterator it = mas.end();
			--it;

			place[-cur] = it;
			wait.push_back(cur);
			++cur;
		}
		else
		{
			int close = wait.back();
			wait.pop_back();

			mas.push_back(-close);
			list<int>::iterator it = mas.end();
			--it;

			place[close] = it;
		}
	}

	list<int>::iterator it = mas.begin();
	for (int i = 1; i < p; ++i) ++it;

	string act;
	cin >> act;

	list<int>::iterator from;
	list<int>::iterator to;
	list<int>::iterator after;

	for (int i = 0; i < m; ++i)
	{
		if (act[i] == 'R') ++it;
		else if (act[i] == 'L') --it;
		else
		{

			if (*it < 0)
			{
				from = place[*it];
				to = place[-(*it)];
			}
			else
			{
				from = place[- (*it)];
				to = place[(*it)];
			}

			++to;
			after = to;

			mas.erase(from, to);

			it = after;
		}

		if (it == mas.end())
		{
			--it;
		}
	}

	for (list<int>::iterator it = mas.begin(); it != mas.end(); ++it)
	{
		if ((*it) > 0) putchar('(');
		else putchar(')');
	}

	cout << endl;

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cctype>
#include <climits>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <deque>
#include <fstream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <iostream>
#include <iomanip>
#include <algorithm>

using namespace std;

#define sz(v) (int)v.size()
#define eps 1e-10
#define all(v) v.begin(), v.end()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a) memset(a,-1,sizeof(a))
#define chk(a,k) ((bool)(a&(1<<(k))))
#define set0(a,k) (a&=(~(1<<(k))))
#define set1(a,k) (a|=(1<<(k)))
#define in(v, x) (find(all(v),x) != v.end())
#define re return
#define sum(v) accumulate(v.begin(),v.end(),(ld)0)
#define tr(v,it) for(auto it=v.begin();it != v.end();it++)
#define asrt(v) sort(v.begin(),v.end())
#define dsrt(v) sort(v.rbegin(),v.rend())
#define rev(v) reverse(v.begin(),v.end())
#define pi 3.1415926535897932384626433832795
#define MOD 1000000007LL
#define print(v) for (auto& i:v) cout<<i<<" "
#define endl '\n'

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<string> vs;
typedef vector<vi> vvi;

const int X=500000+5;

int del[X], L[X], nxt[X], pre[X];
char s[X], z[X], ans[X];

void MAIN() {
	ll n, m, p;
	cin>>n>>m>>p;

	scanf("%s", s);

	stack<int> S;

	for(int i=0; i<n; i++) {

		nxt[i+1]=i+2;
		pre[i+1]=i;

		if(s[i]=='(') {
			S.push(i+1);
		} else{
			ll top=S.top();
			S.pop();

			L[top]=i+1;
			L[i+1]=top;
		}
	}

	scanf("%s", &z);

	for(int i=0; i<m; i++) {
		if(z[i]=='R') {
			p=nxt[p];
		} else if(z[i]=='L') {
			p=pre[p];
		} else{
			int le=p, ri=L[p];
			if(le>ri) swap(le, ri);
			int r1=nxt[ri], l1=pre[le];
			if(r1<=n) {
				p=r1;
				nxt[l1]=r1;
				pre[r1]=l1;
			} else{
				p=l1;
				nxt[l1]=r1;
				pre[r1]=l1;
			}

			for(int q=le; q<=ri; q++) {
				if(del[q]) break;
				del[q]=1;
			}

			for(int q=ri; q>=le; q--) {
				if(del[q]) break;
				del[q]=1;
			}
		}
	}

	int kk=0;
	for(int i=0; i<n; i++) {
		if(!del[i+1]) {
			ans[kk]=s[i];
			kk++;
		}
	}
	printf("%s",ans);
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("Data/input.txt", "r", stdin);
	freopen("Data/output.txt", "w", stdout);
#endif
	MAIN();
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cctype>
#include <climits>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <deque>
#include <fstream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <iostream>
#include <iomanip>
#include <algorithm>

using namespace std;

#define sz(v) (int)v.size()
#define eps 1e-10
#define all(v) v.begin(), v.end()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a) memset(a,-1,sizeof(a))
#define chk(a,k) ((bool)(a&(1<<(k))))
#define set0(a,k) (a&=(~(1<<(k))))
#define set1(a,k) (a|=(1<<(k)))
#define in(v, x) (find(all(v),x) != v.end())
#define re return
#define sum(v) accumulate(v.begin(),v.end(),(ld)0)
#define tr(v,it) for(auto it=v.begin();it != v.end();it++)
#define asrt(v) sort(v.begin(),v.end())
#define dsrt(v) sort(v.rbegin(),v.rend())
#define rev(v) reverse(v.begin(),v.end())
#define pi 3.1415926535897932384626433832795
#define MOD 1000000007LL
#define print(v) for (auto& i:v) cout<<i<<" "
#define endl '\n'

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<string> vs;
typedef vector<vi> vvi;

const int X=500000+5;

int del[X], L[X], nxt[X], pre[X];
char s[X], z[X], ans[X];

void MAIN() {
	ll n, m, p;
	cin>>n>>m>>p;

	scanf("%s", s);

	stack<int> S;

	for(int i=0; i<n; i++) {

		nxt[i+1]=i+2;
		pre[i+1]=i;

		if(s[i]=='(') {
			S.push(i+1);
		} else{
			ll top=S.top();
			S.pop();

			L[top]=i+1;
			L[i+1]=top;
		}
	}

	scanf("%s", &z);

	for(int i=0; i<m; i++) {
		if(z[i]=='R') {
			p=nxt[p];
		} else if(z[i]=='L') {
			p=pre[p];
		} else{
			int le=p, ri=L[p];
			if(le>ri) swap(le, ri);
			int r1=nxt[ri], l1=pre[le];
			if(r1<=n) {
				p=r1;
				nxt[l1]=r1;
				pre[r1]=l1;
			} else{
				p=l1;
				nxt[l1]=r1;
				pre[r1]=l1;
			}

			del[le]=1;
		}
	}

	int kk=0;
	for(int i=1; i<=n; ) {
		if(!del[i]) {
			ans[kk]=s[i-1];
			kk++;
			i++;
		} else{
			i=L[i]+1;
		}
	}
	printf("%s",ans);
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("Data/input.txt", "r", stdin);
	freopen("Data/output.txt", "w", stdout);
#endif
	MAIN();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
 double a[200024];
using namespace std;
    long long n,min1,min2,min3,i; double ans,p,s,e,mid;
int f1(long double mid){
    for(i=0;i<n;i++){
        if(mid>a[i])
        return 0;
    }
    return 1;
}

int f2(long double mid){
    for(i=n;i<2*n;i++){
        if(2*mid>a[i])
        return 0;
    }
    return 1;
}
int main(){

    cin>>n>>p;
    for(i=0;i<2*n;i++)
     scanf("%lf",&a[i]);
    sort(a,a+2*n);
     s=0.0;e=min(a[0],a[n]/2.0);
    for(i=0;i<100;i++){
    //  cout<<s<<" "<<e<<endl;
        mid=(s+e)/2;
        if(p-(3.0*n*mid)>=0)
        s=mid;
        else
        e=mid;
    }
    //cout<<s<<endl;
double ans=3.0*n*s;
printf("%.6lf\n",ans);
return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a[200024];
using namespace std;
int main(){
    long long n,min1,min2,min3,i;long double ans,p;
    cin>>n>>p;
    for(i=0;i<2*n;i++)
    scanf("%I64d",&a[i]);
    sort(a,a+2*n);
    min1=min2=1000000007;
    for(i=0;i<n;i++){
        if(min1>a[i])
        min1=a[i];
    }

    for(i=n;i<2*n;i++){
        if(min2>a[i])
        min2=a[i];
    }

    min3=min(2*min1,min2);
    ans=1.5*n*min3;
    //cout<<ans<<endl;
    if(ans>p)
    cout<<p<<endl;
    else
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
 double a[200024];
using namespace std;
    long long n,min1,min2,min3,i; double ans,p,s,e,mid;
int f1(long double mid){
    for(i=0;i<n;i++){
        if(mid>a[i])
        return 0;
    }
    return 1;
}

int f2(long double mid){
    for(i=n;i<2*n;i++){
        if(2*mid>a[i])
        return 0;
    }
    return 1;
}
int main(){

    cin>>n>>p;
    for(i=0;i<2*n;i++)
     cin>>a[i];
    sort(a,a+2*n);
     s=0.0;e=min(a[0],a[2*n-1]*2);
    while(e-s>0.000001){
    //  cout<<s<<" "<<e<<endl;
        mid=(s+e)/2;
        if(f1(mid)&&f2(mid))
        s=mid;
        else
        e=mid;
    }
double ans=3.0*n*s;
printf("%.6lf\n",ans);
return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a[200024];
using namespace std;
int main(){
    long long n,i;long double ans,p,min1,min2,min3,ans2,min4;
    cin>>n>>p;
    for(i=0;i<2*n;i++)
    scanf("%I64d",&a[i]);
    sort(a,a+2*n);
    min1=min2=2000000027;
    for(i=0;i<n;i++){
        if(min1>a[i])
        min1=a[i];
    }

    for(i=n;i<2*n;i++){
        if(min2>a[i])
        min2=a[i];
    }

   min3=min(2.0*min1,min2);
    ans=1.5*n*min3;
    min4=min(min1,min2/2.0);
    ans2=3.0*n*min4;
    //cout<<ans<<endl;
   cout<<min(p,max(ans,ans2));

    //cout<<ans<<endl;

}


#include<bits/stdc++.h>
using namespace std;
long double a[200024];
using namespace std;
    long long n,min1,min2,min3,i;long double ans,p,s,e,mid;
int f1(long double mid){
    for(i=0;i<n;i++){
        if(mid>a[i])
        return 0;
    }
    return 1;
}

int f2(long double mid){
    for(i=n;i<2*n;i++){
        if(2*mid>a[i])
        return 0;
    }
    return 1;
}
int main(){

    cin>>n>>p;
    for(i=0;i<2*n;i++)
     cin>>a[i];
    sort(a,a+2*n);
     s=0;e=min(a[0],a[2*n-1]*2);
    while(e-s>0.000001){
    //  cout<<s<<" "<<e<<endl;
        mid=(s+e)/2;
        if(f1(mid)&&f2(mid))
        s=mid;
        else
        e=mid;
    }

printf("%.6Lf\n",3.0*n*s);
return 0;
}


#include<bits/stdc++.h>
using namespace std;
 double a[200024];
using namespace std;
    long long n,min1,min2,min3,i; double ans,p,s,e,mid;
int f1(long double mid){
    for(i=0;i<n;i++){
        if(mid>a[i])
        return 0;
    }
    return 1;
}

int f2(long double mid){
    for(i=n;i<2*n;i++){
        if(2*mid>a[i])
        return 0;
    }
    return 1;
}
int main(){

    cin>>n>>p;
    for(i=0;i<2*n;i++)
     cin>>a[i];
    sort(a,a+2*n);
     s=0.0;e=min(a[0],a[2*n-1]*2);
    for(i=0;i<100;i++){
    //  cout<<s<<" "<<e<<endl;
        mid=(s+e)/2;
        if(f1(mid)&&f2(mid))
        s=mid;
        else
        e=mid;
    }
double ans=3.0*n*s;
printf("%.6lf\n",ans);
return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    int n;
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = a[n + 1] / 2;
    double x;
    while (l <= r) {
          double mid = (l + r) / 2;
          if (mid > a[1] || mid * 3 * n > w) {
             r = mid - 0.0000001;
          } else {
             x = mid;
             l = mid + 0.0000001;
          }
    }
    pr("%.6lf", x * n * 3);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];
int n;
bool go(double f) {
     if (f > a[1] || f * 2 > a[n + 1]) {
        return false;
     }
     return true;
}

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = w / 3;
    double x;
    while (l <= r) {
          double mid = (l + r) / 2;
          if (!go(mid)) {
             r = mid - 0.0000001;
          } else {
             x = mid;
             l = mid + 0.0000001;
          }
    }
    double ans = x * n * 3;
    pr("%.6lf", ans);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    int n;
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = a[n + 1] / 2;
    double x;
    while (l <= r) {
          double mid = (l + r) / 2;
          if (mid > a[1] || (mid * 3 * n > w || mid * 3 * n < 0)) {
             r = mid - 0.0000001;
          } else {
             x = mid;
             l = mid + 0.0000001;
          }
    }
    pr("%.6lf", x * n  * 3);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    int n;
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double x = a[n + 1] / 2;
    while (x > a[1] || (x * n * 3) > w) {
          x /= 2;
    }
    pr("%.6lf", x * n * 3);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[300500];
int n;
bool go(double f) {
     if (f > a[1] || f * 2 > a[n + 1]) {
        return false;
     }
     return true;
}

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    double w;
    sc("%d%lf", &n, &w);
    for (int i = 1; i <= 2 * n; i++) {
        sc("%lf", &a[i]);
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0;
    double r = w / 3.0 / (n * 1.0);
    double x = 0;
    for (int i = 1; i <= 50; i++) {
        double mid = (l + r) / 2;
        if (!go(mid)) {
           r = mid;
        } else {
           x = mid;
           l = mid;
        }
    }
    double ans = x * (n * 1.0) * 3.0;
    pr("%.6lf\n", ans);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];
int n;
bool go(double f) {
     if (f > a[1] || f * 2 > a[n + 1]) {
        return false;
     }
     return true;
}

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = w / 3.0 / (n * 1.0);
    double x;
    while (l <= r) {
          double mid = (l + r) / 2;
          if (!go(mid)) {
             r = mid - 0.0000001;
          } else {
             x = mid;
             l = mid + 0.0000001;
          }
    }
    double ans = x * n * 1.0 * 3;
    pr("%.6lf", ans);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    int n;
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = a[n + 1] / 2;
    double x;
    while (l <= r) {
          double mid = (l + r) / 2;
          if (mid > a[1] || mid * 1ll * 3 * 1ll * n > w) {
             r = mid - 0.0000001;
          } else {
             x = mid;
             l = mid + 0.0000001;
          }
    }
    pr("%.6lf", x * 1ll * n * 1ll * 3);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    int n;
    long double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    long double l = 0.0000001;
    long double r = a[n + 1] / 2;
    long double x;
    while (l <= r) {
          long double mid = (l + r) / 2;
          if (mid > a[1] || mid * 3 * n > w) {
             r = mid - 0.0000001;
          } else {
             x = mid;
             l = mid + 0.0000001;
          }
    }
    pr("%.6lf", x * n * 3);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];
int n;
bool go(double f) {
     if (f > a[1] || f * 2 > a[n + 1]) {
        return false;
     }
     return true;
}

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = w / 3.0 / (n * 1.0);
    double x = 0;
    while (l <= r) {
          double mid = (l + r) / 2;
          if (!go(mid)) {
             r = mid - 0.0000001;
          } else {
             x = mid;
             l = mid + 0.0000001;
          }
    }
    double ans = x * n * 1.0 * 3.0;
    pr("%.6lf", ans);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[300500];
int n;
bool go(double f) {
     if (f > a[1] || f * 2 > a[n + 1]) {
        return false;
     }
     return true;
}

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = w / 3.0 / (n * 1.0);
    double x = 0;
    for (int i = 1; i <= 50; i++) {
        double mid = (l + r) / 2;
        if (!go(mid)) {
           r = mid;
        } else {
           x = mid;
           l = mid;
        }
    }
    double ans = x * (n * 1.0) * 3.0;
    pr("%.6lf", ans);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    int n;
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = a[n + 1] / 2;
    double x;
    while (l <= r) {
          double mid = (l + r) / 2;
          if (mid > a[1] || (mid * 3 * n > w || mid * 3 * n < 0)) {
             r = mid - 0.0000001;
          } else {
             x = mid;
             l = mid + 0.0000001;
          }
    }
    pr("%.6lf", x * 1ll * n * 1ll * 3);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[300500];
int n;
bool go(double f) {
     if (f > a[1] || f * 2 > a[n + 1]) {
        return false;
     }
     return true;
}

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = w / 3.0 / (n * 1.0);
    double x = 0;
    for (int i = 1; i <= 100; i++) {
        double mid = (l + r) / 2;
        if (!go(mid)) {
           r = mid;
        } else {
           x = mid;
           l = mid;
        }
    }
    double ans = x * (n * 1.0) * 3.0;
    pr("%.6lf", ans);
    return 0;
}


// Made By Haireden Aibyn
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define fname "put.txt"
#define INF 2147483647
#define MOD 1000000007
#define sc scanf
#define pr printf
#define pb push_back
#define ex exit(0)
#define tim printf("%.4lf\n", (clock() * 1.) / CLOCKS_PER_SEC)
#define cas printf(""), ex;
#define y1 y4

typedef long long ll;
typedef unsigned long long ull;

double a[100500];
int n;
bool go(double f) {
     if (f > a[1] || f * 2 > a[n + 1]) {
        return false;
     }
     return true;
}

int main () {
    srand(time(NULL));
    #ifndef ONLINE_JUDGE
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
    #endif
    double w;
    cin >> n >> w;
    for (int i = 1; i <= 2 * n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + 1 + 2 * n);
    double l = 0.0000001;
    double r = w / 3.0 / (n * 1.0);
    double x = 0;
    for (int i = 1; i <= 100; i++) {
        double mid = (l + r) / 2;
        if (!go(mid)) {
           r = mid;
        } else {
           x = mid;
           l = mid;
        }
    }
    double ans = x * (n * 1.0) * 3.0;
    pr("%.6lf", ans);
    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, w;
    float result;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    // Step through each element of the array
    for (int startIndex = 0; startIndex < 2*n; ++startIndex)
    {
        // smallestIndex is the index of the smallest element we've encountered so far.
        int smallestIndex = startIndex;

        // Look for smallest element remaining in the array (starting at startIndex+1)
        for (int currentIndex = startIndex + 1; currentIndex < 2*n; ++currentIndex)
        {
            // If the current element is smaller than our previously found smallest
            if (glass[currentIndex] < glass[smallestIndex])
                // This is the new smallest number for this iteration
                smallestIndex = currentIndex;
        }

        // Swap our start element with our smallest element
        swap(glass[startIndex], glass[smallestIndex]);
    }

    if ((glass[n]*3)>w) {
        if (glass[n]>(glass[0]*2)) {
            result = (float)1/3*w + (float)1/3*w*2;
        } else { result = (float)2/3*w + (float)2/3*w/2;}
    } else {
        if (glass[n]>(glass[0]*2)) {
            result = glass[0]*n + glass[0]*2*n;
        } else { result = glass[n]*n + (float)glass[n]*n/2;}
    }

    cout << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <cstdio>
#include <algorithm>
using namespace std;

int main() {
    int n, w;
    float result;
    scanf("%d %d", &n, &w);
    int glass[2*n];
    for(int i=0; i<(2*n); i++) {
        scanf("%d", &glass[i]);
    }

    // sorting
    sort(glass,glass+2*n);

    if (glass[n]>(glass[0]*2)) {
        result = glass[0]*n*3;
    } else {
        result = (float)glass[n]*n*1.5;}

    if (w<=result) {result = w;}
    printf("%.10f \n", result);

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;

int main() {
    int n, w;
    float result;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    sort(glass,glass+2*n);
    /*if (w<=(glass[0]*n)) {result = w;} else */{
        if (glass[n]>(glass[0]*2)) {
        result = glass[0]*n + glass[0]*2*n;
        if (w<=(glass[0]*n)) {result = w;}
    } else { result = glass[n]*n + (float)glass[n]*n/2;
if (w<=(glass[0]*n)) {result = w;}}
    }

    printf("%.10f \n", result);
    //cout << setprecision(20) << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, w;
    float result, temp;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    // Step through each element of the array
    for (int startIndex = 0; startIndex < 2*n; ++startIndex)
    {
        // smallestIndex is the index of the smallest element we've encountered so far.
        int smallestIndex = startIndex;

        // Look for smallest element remaining in the array (starting at startIndex+1)
        for (int currentIndex = startIndex + 1; currentIndex < 2*n; ++currentIndex)
        {
            // If the current element is smaller than our previously found smallest
            if (glass[currentIndex] < glass[smallestIndex])
                // This is the new smallest number for this iteration
                smallestIndex = currentIndex;
        }

        // Swap our start element with our smallest element
        swap(glass[startIndex], glass[smallestIndex]);
    }

    if (w<(glass[n]*n)) {result = w;} else {
        if (glass[n]>(glass[0]*2)) {
        temp = glass[0]*n;
        result = glass[0]*n + glass[0]*2*n;
    } else { result = glass[n]*n + (float)glass[n]*n/2;}
    }

    cout << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, w;
    float result;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    // Step through each element of the array
    for (int startIndex = 0; startIndex < 2*n; ++startIndex)
    {
        // smallestIndex is the index of the smallest element we've encountered so far.
        int smallestIndex = startIndex;

        // Look for smallest element remaining in the array (starting at startIndex+1)
        for (int currentIndex = startIndex + 1; currentIndex < 2*n; ++currentIndex)
        {
            // If the current element is smaller than our previously found smallest
            if (glass[currentIndex] < glass[smallestIndex])
                // This is the new smallest number for this iteration
                smallestIndex = currentIndex;
        }

        // Swap our start element with our smallest element
        swap(glass[startIndex], glass[smallestIndex]);
    }

    if (glass[n]>(glass[0]*2)) {
        result = glass[0]*n + glass[0]*2*n;
    } else { result = glass[n]*n + (float)glass[n]*n/2;}

    cout << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;

int main() {
    int n, w;
    float result;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    sort(glass,glass+2*n);
    /*if (w<=(glass[0]*n)) {result = w;} else */{
        if (glass[n]>(glass[0]*2)) {
        result = glass[0]*n + glass[0]*2*n;
        if (w<=result) {result = w;}
    } else { result = glass[n]*n + (float)glass[n]*n/2;
if (w<=result) {result = w;}}
    }

    printf("%.10f \n", result);
    //cout << setprecision(20) << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, w;
    float result, temp;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    sort(glass,glass+2*n);

    if (w<(glass[n]*n)) {result = w;} else {
        if (glass[n]>(glass[0]*2)) {
        temp = glass[0]*n;
        result = glass[0]*n + glass[0]*2*n;
    } else { result = glass[n]*n + (float)glass[n]*n/2;}
    }

    cout << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, w, cowok=0, cewek=0;
    float result, temp;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    sort(glass,glass+2*n);

    for(int i=0; i<n; i++) {
        cowok+=glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cewek+=glass[i];
    }

    if (w<(cowok+cewek)) {result = w;} else {
        if (glass[n]>(glass[0]*2)) {
        //temp = glass[0]*n;
        result = glass[0]*n + glass[0]*2*n;
    } else { result = glass[n]*n + (float)glass[n]*n/2;}
    }

    cout << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, w;
    float result, temp;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    sort(glass,glass+n);

    if (w<(glass[n]*n)) {result = w;} else {
        if (glass[n]>(glass[0]*2)) {
        temp = glass[0]*n;
        result = glass[0]*n + glass[0]*2*n;
    } else { result = glass[n]*n + (float)glass[n]*n/2;}
    }

    cout << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;

int main() {
    int n, w;
    float result;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    sort(glass,glass+2*n);

    if (w<(glass[n]*n)) {result = w;} else {
        if (glass[n]>(glass[0]*2)) {
        result = glass[0]*n + glass[0]*2*n;
    } else { result = glass[n]*n + (float)glass[n]*n/2;}
    }

    cout << setprecision(10) << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, w;
    float result, temp;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    sort(glass,glass+2*n);

    if (w<(glass[n]*n+glass[n-1]*n)) {result = w;} else {
        if (glass[n]>(glass[0]*2)) {
        temp = glass[0]*n;
        result = glass[0]*n + glass[0]*2*n;
    } else { result = glass[n]*n + (float)glass[n]*n/2;}
    }

    cout << result << endl;

    return 0;
}


// pasha and tea codeforces
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;

int main() {
    int n, w;
    float result;
    cin >> n >> w;
    int glass[2*n];
    for(int i=0; i<n; i++) {
        cin >> glass[i];
    }
    for(int i=n; i<(2*n); i++) {
        cin >> glass[i];
    }

    // sorting
    sort(glass,glass+2*n);
    if (w<=(glass[0]*n)) {result = w;} else {
        if (glass[n]>(glass[0]*2)) {
        result = glass[0]*n + glass[0]*2*n;
    } else { result = glass[n]*n + (float)glass[n]*n/2;}
    }

    printf("%.10f \n", result);
    //cout << setprecision(20) << result << endl;

    return 0;
}


#include<bits/stdc++.h>
#include<stdint.h>
using namespace std;
int64_t a[200005];
int main(){
   int64_t n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int64_t x = a[0];
   int64_t y = a[n];

   int64_t u = min(y,x*2);

   int64_t ans = 0;

   ans = min(3*n*u,2*w);
   //cout<<ans<<"\n";
   cout<<ans/2;
   if(ans%2!=0){
       cout<<".5";
   }

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int x = a[0];
   int y = a[n];

   int u = min(y,x*2);

   double ans = 0;
   if(w <= u){
       ans = w;
   }
   else{
       ans = 3*n*u*0.5;
   }

   ans = min(ans,(double)w);

//   for(int i=0;i<n;i++){
//       if(3*u <= w){
//           ans+=3*u;
//           w-=3*u;
//       }
//   }

   cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   double x = a[0];
   double y = a[n];

   double u = min(y/2,x);
   double e= 1/1000000;
   double ans = 0;
   if(w <= u){
       ans = w;
   }
   else{
       ans -=e;
   }

   for(int i=0;i<n;i++){
       if(u <= w){
           ans+=3*u;
           w-=3*u;
       }
   }

   cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int x = a[0];
   int y = a[n];

   int u = min(y,x*2);

   double ans = 0;
   if(w <= u){
       ans = w;
   }
   else{
       ans = 3*n*u*0.5;
   }

//   for(int i=0;i<n;i++){
//       if(3*u <= w){
//           ans+=3*u;
//           w-=3*u;
//       }
//   }

   cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int x = a[0];
   int y = a[n];

   int u = min(y,x*2);

   double ans = 0;
   if(w <= u){
       ans = w;
   }
   else{
       ans = 3*n*u*0.5;
   }

   ans = min(ans,(double)w);

//   for(int i=0;i<n;i++){
//       if(3*u <= w){
//           ans+=3*u;
//           w-=3*u;
//       }
//   }

   cout<<ans+0.5;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   double x = a[0];
   double y = a[n];

   double u = min(y/2,x);

   double ans = 0;
   if(w <= u){
       ans = w;
   }
   else{
       ans = 3*n*u;
   }

//   for(int i=0;i<n;i++){
//       if(3*u <= w){
//           ans+=3*u;
//           w-=3*u;
//       }
//   }

   cout<<ans;

}


#include<bits/stdc++.h>
#include<stdint.h>
using namespace std;
int64_t a[200005];
int main(){
   int64_t n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int64_t x = a[0];
   int64_t y = a[n];

   int64_t u = min(y,x*2);

   int64_t ans = 0;

   ans = min(3*n*u,2*w);
   //cout<<ans<<"\n";
   cout<<ans/2;
   if(ans%2!=0){
       cout<<0.5;
   }

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int x = a[0];
   int y = a[n];

   int u = min(y,x*2);

   double ans = 0;

   ans = min(3*n*u,2*w);

   ans/=2;

   cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int x = a[0];
   int y = a[n];

   int u = min(y,x*2);

   double ans = 0;
   if(w <= u){
       ans = w;
   }
   else{
       ans = 3*n*u*0.5;
   }

   ans = min(ans,w);

//   for(int i=0;i<n;i++){
//       if(3*u <= w){
//           ans+=3*u;
//           w-=3*u;
//       }
//   }

   cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int x = a[0];
   int y = a[n];

   int u = min(y,x*2);

   double ans = 0;

   ans = 3*n*u;

   ans/=2;

   ans = min(ans,(double)w);

   cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   double x = a[0];
   double y = a[n];

   double u = min(y/2,x);
   double ans = 0;
   if(w <= u){
       ans = w;
   }

   for(int i=0;i<n;i++){
       if(u <= w){
           ans+=3*u;
           w-=3*u;
       }
   }

   cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   double x = a[0];
   double y = a[n];

   double u = min(y/2,x);

   double ans = 0;

   for(int i=0;i<n;i++){
       if(u <= w){
           ans+=3*u;
           w-=3*u;
       }
   }

   cout<<ans;

}


#include<bits/stdc++.h>
#include<stdint.h>
using namespace std;
int64_t a[200005];
int main(){
   int64_t n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   int64_t x = a[0];
   int64_t y = a[n];

   int64_t u = min(y,x*2);

   double ans = 0;

   ans = min(3*n*u,2*w);
   //cout<<ans<<"\n";
   ans = ans*0.5;

   cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
   int n,w;
   cin>>n>>w;
   for(int i=0;i<2*n;i++){
       cin>>a[i];
   }
   sort(a,a+2*n);

   double x = a[0];
   double y = a[n];

   double u = min(y/2,x);

   double ans = 0;
   if(w <= u){
       ans = w;
   }

   for(int i=0;i<n;i++){
       if(3*u <= w){
           ans+=3*u;
           w-=3*u;
       }
   }

   cout<<ans;

}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],((double) w)/((double) n*3));
    maxb=min((double) c[n],maxg*2.0);
    maxg=maxb/2.0;
    cout<<maxg*((double) n*3);
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],(double) c[n]/2.0);
    //maxg=min((double) w/(((double) n)*3.0),maxg);
    cout<<min(maxg*(double)n*3.0,(double)w);
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    long long n;
    double w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(long long i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],((double) w)/((double) n*3));
    maxb=min((double) c[n],maxg*2);
    maxg=maxb/2;
    cout<<maxg*3*n;
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],((double) w)/((double) n*3));
    maxb=min((double) c[n],maxg*2);
    maxg=maxb/2;
    cout<<maxg*3*n;
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min(c[0],c[n]/2);
    maxg=min((double) w/(((double) n)*3.0),maxg);
    cout<<maxg*((double) n*3);
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    long long n;
    long long w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(long long i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],((double) w)/((double) n*3));
    maxb=min((double) c[n],maxg*2);
    maxg=maxb/2;
    cout<<maxg*((double) n*3);
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    long long n;
    long long w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(long long i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],((double) w)/((double) n*3));
    maxb=min((double) c[n],maxg*2);
    maxg=maxb/2;
    cout<<maxg*3*n;
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n;
    float w,maxg,maxb,c[100005];
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min(c[0],w/(n*3));
    maxb=min(c[n],maxg*2);
    maxg=maxb/2;
    cout<<maxg*3*n;
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n;
    float w,maxg,maxb,c[100005];
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+n);
    maxg=min(c[0],w/(n*3));
    maxb=min(c[n],maxg*2);
    maxg=maxb/2;
    cout<<maxg*3*n;
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    float maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((float) c[0],((float) w)/((float) n*3));
    maxb=min((float) c[n],maxg*2);
    maxg=maxb/2;
    cout<<maxg*3*n;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],(double) c[n]/2.0);
    //maxg=min((double) w/(((double) n)*3.0),maxg);
   // cout<<min(maxg*(double)n*3.0,(double)w);
    printf("%lf",min(maxg*(double)n*3.0,(double)w));
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],(double) c[n]/2.0);
    //maxg=min((double) w/(((double) n)*3.0),maxg);
    cout<<min(maxg*n*3,(double)w);
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],(double) c[n]/2.0);
    maxg=min((double) w/(((double) n)*3.0),maxg);
    cout<<maxg*((double) n*3);
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    float maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((float) c[0],((float) w)/((float) n*3));
    maxb=min((float) c[n],maxg*2);
    maxg=maxb/2;
    //cout<<maxg*3*n;
    printf("%lf",maxg*3*n);
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[200005];
    double maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((double) c[0],(double) c[n]/2.0);
    //maxg=min((double) w/(((double) n)*3.0),maxg);
    cout<<min(maxg*(double)n*3.0,(double)w);
    printf("%lf",min(maxg*(double)n*3.0,(double)w));
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;
int main()
{

    int n,w,c[100005];
    float maxg,maxb;
    cin>>n>>w;
    for(int i=0;i<2*n;i++)
        cin>>c[i];
    sort(c,c+2*n);
    maxg=min((float) c[0],((float) w)/((float) n*3));
    maxb=min((float) c[n],maxg*2);
    maxg=maxb/2;
    cout<<maxg*3*n;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *) a) - (*(ll *)b);
}
int main()
{
	ll v[23000];

	ll w;

	int n;

	cin >> n >> w;

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

	qsort(v, 2 * n, sizeof(ll), cmp);

	ll mn = v[n];

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int v[200005];

	int n, w;

	while (cin >> n >> w)
	{
		for (int i = 0 ; i < 2 * n ; ++i)
			cin >> v[i];

		sort(v, v + 2 * n);

		int boy = min(v[n], 2 * v[0]);
		cout << setprecision(10) << min((double)boy * (double)n + (double)(boy * n) / 2.0, (double)w) << '\n';
	}
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *) a) - (*(ll *)b);
}
int main()
{
	ll v[23000];

	ll w;

	int n;

	cin >> n >> w;

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

	qsort(v, 2 * n, sizeof(ll), cmp);

	ll mn = *min_element((v + n), v + 2 * n);

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int v[100005];

	int n, w;

	while (cin >> n >> w)
	{
		for (int i = 0 ; i < 2 * n ; ++i)
			cin >> v[i];

		sort(v, v + 2 * n);

		int boy = min(v[n], 2 * v[0]);
		cout << min((double)boy * (double)n + (double)(boy * n) / 2.0, (double)w) << '\n';
	}
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *)a) - (*(ll *)b);
}

int main()
{
	ll v[230000];

	cout.precision(6);
	ll w;

	int n;

	cin >> n >> w;
	ll maior = INT_MIN;
	ll menor = INT_MAX;
	double ans;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

		if (menor > v[i]) menor = v[i];
		if (maior < v[i]) maior = v[i];

	}
	ll mn;
	if (maior != menor)
	{
		qsort(v, 2 * n, sizeof(ll), cmp);

		mn = min(v[n], 2 * v[0]);
	} else mn = maior;

	ans = (double)(n * mn) + (double)(mn * n )/ 2.0;
	if (ans > (double)w) ans = (double) w;

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


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
	ll v[23000];

	ll w;

	int n;
	int ordenacao = 0;

	cin >> n >> w;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];
		if (i && v[i] < v[i - 1]) ordenacao = 1;

	}
	if (ordenacao)
		sort(v, v + 2 * n);

	ll mn = v[n];

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int v[200005];

	int n, w;

	while (cin >> n >> w)
	{
		for (int i = 0 ; i < 2 * n ; ++i)
			cin >> v[i];

		sort(v, v + 2 * n);

		int boy = min(v[n], 2 * v[0]);
		cout << min((double)boy * (double)n + (double)(boy * n) / 2.0, (double)w) << '\n';
	}
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *)a) - (*(ll *)b);
}

int main()
{
	ll v[230000];

	cout.precision(20);
	ll w;

	int n;

	cin >> n >> w;
	ll maior = INT_MIN;
	ll menor = INT_MAX;
	double ans;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

		if (menor > v[i]) menor = v[i];
		if (maior < v[i]) maior = v[i];

	}
	ll mn;
	if (maior != menor)
	{
		qsort(v, 2 * n, sizeof(ll), cmp);

		mn = min(v[n], 2 * v[0]);
	} else mn = maior;

	ans = (double)(n * mn) + (double)(mn * n )/ 2.0;
	if (ans > (double)w) ans = (double) w;

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


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
void merge(ll vec[], ll vecSize) {
  ll mid;
  int i, j, k;
  ll* tmp;

  tmp = (ll*) malloc(vecSize * sizeof(ll));
  if (tmp == NULL) {
    exit(1);
  }

  mid = vecSize / 2;

  i = 0;
  j = mid;
  k = 0;
  while (i < mid && j < vecSize) {
    if (vec[i] <= vec[j]) {
      tmp[k] = vec[i++];
    }
    else {
      tmp[k] = vec[j++];
    }
    ++k;
  }

  if (i == mid) {
    while (j < vecSize) {
      tmp[k++] = vec[j++];
    }
  }
  else {
    while (i < mid) {
      tmp[k++] = vec[i++];

    }
  }

  for (i = 0; i < vecSize; ++i) {
    vec[i] = tmp[i];
  }

  free(tmp);
}

void mergeSort(ll vec[], ll vecSize) {
  ll mid;

  if (vecSize > 1) {
    mid = vecSize / 2;
    mergeSort(vec, mid);
    mergeSort(vec + mid, vecSize - mid);
    merge(vec, vecSize);
  }
}

int main()
{
	ll v[23000];

	ll w;

	int n;

	cin >> n >> w;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

	}
	ll mn;
	mergeSort(v, 2 * n);

	mn = v[n];

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *) a) - (*(ll *)b);
}
int main()
{
	ll v[23000];

	ll w;

	int n;

	cin >> n >> w;

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

	qsort(v, 2 * n, sizeof(ll), cmp);

	ll mn = *min_element((v + n), v + 2 * n);

	cout << (double)(n * mn) + (double)(mn * n )/ 2.0 << '\n';
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *)a) - (*(ll *)b);
}

int main()
{
	ll v[230000];

	ll w;

	int n;

	cin >> n >> w;
	ll maior = INT_MIN;
	ll menor = INT_MAX;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

		if (menor > v[i]) menor = v[i];
		if (maior < v[i]) maior = v[i];

	}
	ll mn;
	if (maior != menor)
	{
		qsort(v, 2 * n, sizeof(ll), cmp);

		mn = v[n];
	} else mn = maior;

	cout << (double)(n * mn) + (double)(mn * n )/ 2.0 << '\n';
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
	ll v[23000];

	ll w;

	int n;
	int ordenacao = 0;

	cin >> n >> w;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

	}
	sort(v, v + 2 * n);

	ll mn = v[n];

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
void merge(ll vec[], ll vecSize) {
  ll mid;
  int i, j, k;
  ll* tmp;

  tmp = (ll*) malloc(vecSize * sizeof(ll));
  if (tmp == NULL) {
    exit(1);
  }

  mid = vecSize / 2;

  i = 0;
  j = mid;
  k = 0;
  while (i < mid && j < vecSize) {
    if (vec[i] <= vec[j]) {
      tmp[k] = vec[i++];
    }
    else {
      tmp[k] = vec[j++];
    }
    ++k;
  }

  if (i == mid) {
    while (j < vecSize) {
      tmp[k++] = vec[j++];
    }
  }
  else {
    while (i < mid) {
      tmp[k++] = vec[i++];

    }
  }

  for (i = 0; i < vecSize; ++i) {
    vec[i] = tmp[i];
  }

  free(tmp);
}

void mergeSort(ll vec[], ll vecSize) {
  ll mid;

  if (vecSize > 1) {
    mid = vecSize / 2;
    mergeSort(vec, mid);
    mergeSort(vec + mid, vecSize - mid);
    merge(vec, vecSize);
  }
}

int main()
{
	ll v[230000];

	ll w;

	int n;

	cin >> n >> w;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

	}
	ll mn;
	mergeSort(v, 2 * n);

	mn = v[n];

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *)a) - (*(ll *)b);
}

int main()
{
	ll v[230000];

	cout.precision(6);
	ll w;

	int n;

	cin >> n >> w;
	ll maior = INT_MIN;
	ll menor = INT_MAX;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

		if (menor > v[i]) menor = v[i];
		if (maior < v[i]) maior = v[i];

	}
	ll mn;
	if (maior != menor)
	{
		qsort(v, 2 * n, sizeof(ll), cmp);

		mn = min(v[n], 2 * v[0]);
	} else mn = maior;

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *)a) - (*(ll *)b);
}

int main()
{
	ll v[230000];

	ll w;

	int n;

	cin >> n >> w;
	ll maior = INT_MIN;
	ll menor = INT_MAX;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

		if (menor > v[i]) menor = v[i];
		if (maior < v[i]) maior = v[i];

	}
	ll mn;
	if (maior != menor)
	{
		qsort(v, 2 * n, sizeof(ll), cmp);

		mn = v[n];
	} else mn = maior;

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int cmp(const void *a, const void *b)
{
	return (*(ll *)a) - (*(ll *)b);
}

int main()
{
	ll v[230000];

	ll w;

	int n;

	cin >> n >> w;
	ll maior = INT_MIN;
	ll menor = INT_MAX;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> v[i];

		if (menor > v[i]) menor = v[i];
		if (maior < v[i]) maior = v[i];

	}
	ll mn;
	if (maior != menor)
	{
		qsort(v, 2 * n, sizeof(ll), cmp);

		mn = min(v[n], 2 * v[0]);
	} else mn = maior;

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
	ll v[23000];
	ll v2[23000];

	map<ll, int> m;

	ll w;
	ll x;

	int n;
	int ordenacao = 0;

	cin >> n >> w;

	for(int i = 0 ; i < 2 * n ; ++i)
	{
		cin >> x;

		++m[x];

	}
	ll mn;
	int i = 0;
	for (map<ll, int> :: iterator it = m.begin(); it != m.end(); ++it)
	{
		v2[i] = it->first;
		++i;
	}
	sort(v2, v2 + i);
	mn = v2[i / 2];

	cout << min((double)(n * mn) + (double)(mn * n )/ 2.0, (double)w) << '\n';
}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

int a[222222];

int main()
{

    int n,i,j,k;
    int w;
    double by,gi;
    double ra,r1,ans,ans1;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

   if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;
       ans1=min(ans,double(w));

     //  cout<<min(ans,double(w))<<endl;

       printf("%.12lf\n",ans1);
       return 0;

   }

    ra=by/gi;
    r1=ra;
    double sss=0;
    while(r1)
    {
        if(r1<.5)
            break;
        r1=r1-.5;
        sss=sss+.5;

    }

    ra=sss;

    if(ra>=2.00)
    {

       ans=gi*n+gi*2.00*n;

    }

    else if(ra<2.00)
    {

       ra=2.00-ra;
       gi=gi-ra;
       ans=gi*n+by*n;

    }

   ans1=min(ans,double(w));

     //  cout<<min(ans,double(w))<<endl;

       printf("%.12lf\n",ans1);

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

int a[100006];

int main()
{

    int n,i,j,k;
    int w;
    double by,gi;
    double ra,r1,ans;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

   if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;

       cout<<min(ans,double(w))<<endl;
       return 0;

   }

    ra=by/gi;

    if(ra>=2.00)
    {

       ans=gi*n+gi*2.00*n;

    }

    else if(ra<2.00)
    {

       ra=2.00-ra;
       gi=gi-ra;
       ans=gi*n+by*n;

    }

   cout<<min(ans,(double)w)<<endl;

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

int a[222222];

int main()
{

    int n,i,j,k;
    int w;
    double by,gi;
    double ra,r1,ans,ans1;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

   if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;
       ans1=min(ans,double(w));
       int pp=ans1;

       printf("%.12lf\n",(double)pp);
       return 0;

   }

    ra=by/gi;

    if(ra>=2.00)
    {

       ans=gi*n+gi*2.00*n;

    }

    else if(ra<2.00)
    {

       ra=2.00-ra;
       gi=gi-ra;
       ans=gi*n+by*n;

    }

   ans1=min(ans,double(w));
   int pp=ans1;

     //  cout<<min(ans,double(w))<<endl;

       printf("%.12lf\n",(double)pp);

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>

using namespace std;

long long int a[100006];

int main()
{

    unsigned long long int n,w,k;
    long double num1,num2;
    __int64 i,j,m;

    cin>>n>>w;

    for(i=0;i<2*n;i++)
    {
        cin>>a[i];
    }

    k=2*n;
    sort(a,a+k);
    long double sum=0;

    num1=(double)a[k-1];
    num2=(double)a[n-1];

    if(num1==num2)
    {
        num2=num2/2.00;
        sum=sum+(double)n*(num2);
        sum=sum+(double)n*(2.00)*num2;

        if(sum<=w)
        printf("%.9lf\n",sum);

        else
            printf("%.9lf",(double)w);

        return 0;

    }

    cout<<num1<<"  "<<num2<<endl;

    double ral,re;

    ral=(double)num1/(double)(num2);

    if(ral<2.00)
    {
        re=2.00-ral;
        num2=num2-re;

    }

    sum=sum+(double)n*(double)num2;
    sum=sum+(double)n*(2.00)*(num2);

    if(sum<=w)
    printf("%.9lf",sum);

    else
    printf("%.9lf",(double)w);

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>

using namespace std;

unsigned long long a[100006];

int main()
{

    unsigned long long n,w,k;
    double num1,num2;
    __int64 i,j,m;

    cin>>n>>w;

    for(i=0;i<2*n;i++)
    {
        cin>>a[i];
    }

    k=2*n;
    sort(a,a+k);
    double sum=0;

    num1=(double)a[k-1];
    num2=(double)a[n-1];

    if(num1==num2)
    {
        num2=num2/2.00;
        sum=sum+(double)n*(num2);
        sum=sum+(double)n*(2.00)*num2;
        if(sum<=(double)w)
        cout<<sum<<endl;

        else
            cout<<w<<endl;
        return 0;

    }

  //  cout<<num1<<"  "<<num2<<endl;

    double ral,re;

    ral=(double)num1/(double)(num2);

    if(ral<2.00)
    {
        re=2.00-ral;
        num2=num2-re;

    }

    sum=sum+(double)n*(double)num2;
    sum=sum+(double)n*(2.00)*(num2);

     if(sum<=(double)w)
        cout<<sum<<endl;

        else
            cout<<w<<endl;

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

int a[222222];

int main()
{

    int n,i,j,k;
    int w;
    double by,gi;
    double ra,r1,ans;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

   if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;

       cout<<min(ans,double(w))<<endl;
       return 0;

   }

    ra=by/gi;

    if(ra>=2.00)
    {

       ans=gi*n+gi*2.00*n;

    }

    else if(ra<2.00)
    {

       ra=2.00-ra;
       gi=gi-ra;
       ans=gi*n+by*n;

    }

   cout<<min(ans,(double)w)<<endl;

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

int a[100006];

int main()
{

    int n,i,j,k;
    int w;
    double by,gi,ans1;
    double ra,r1,ans;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

 /*  if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;
       ans1=min(ans,double(w));
       //cout<<min(ans,double(w))<<endl;
       printf("%.9lf\n",ans1);
       return 0;

   }

*/

   // ra=by/gi;

    if(gi*2.00>by)
    {

        ans =  (double)by * n * 1.5;  // maxv/2 * n + maxv * n;

    }

    else
    {

        ans = (double)gi* n * 3.0;

    }

   ans1=min(ans,double(w));
       //cout<<min(ans,double(w))<<endl;
       printf("%.9lf\n",ans1);

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

int a[222222];

int main()
{

    int n,i,j,k;
    int w;
    double by,gi,ans1;
    double ra,r1,ans;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

 /*  if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;
       ans1=min(ans,double(w));
       //cout<<min(ans,double(w))<<endl;
       printf("%.9lf\n",ans1);
       return 0;

   }

*/

   // ra=by/gi;

    if(gi*2.00>by)
    {

        ans =  (double)by * n * 1.5;  // maxv/2 * n + maxv * n;

    }

    else
    {

        ans = (double)gi* n * 3.0;

    }

   ans1=min(ans,double(w));
       //cout<<min(ans,double(w))<<endl;
       printf("%.9lf\n",ans1);

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>

using namespace std;

unsigned long long a[100006];

int main()
{

    long long int n,w,k;
    double num1,num2;
    __int64 i,j,m;

    cin>>n>>w;

    for(i=0;i<2*n;i++)
    {
        cin>>a[i];
    }

    k=2*n;
    sort(a,a+k);
    double sum=0;

    num1=(double)a[k-1];
    num2=(double)a[n-1];

    if(num1==num2)
    {
        num2=num2/2.00;
        sum=sum+(double)n*(num2);
        sum=sum+(double)n*(2.00)*num2;
        if(sum<=(double)w)
        cout<<sum<<endl;

        else
            cout<<w<<endl;
        return 0;

    }

  //  cout<<num1<<"  "<<num2<<endl;

    double ral,re;

    ral=(double)num1/(double)(num2);

    if(ral<2.00)
    {
        re=2.00-ral;
        num2=num2-re;

    }

    sum=sum+(double)n*(double)num2;
    sum=sum+(double)n*(2.00)*(num2);

     if(sum<=(double)w)
        cout<<sum<<endl;

        else
            cout<<w<<endl;

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

int a[222222];

int main()
{

    int n,i,j,k;
    int w;
    double by,gi;
    double ra,r1,ans,ans1;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

   if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;
       ans1=min(ans,double(w));
       double ans3;
       ans3=(int)ans1;

       if((ans1-ans3)>=.5)
         ans1=ans1+1.000;

       else
        ans1=ans1-1.000;

     //  cout<<min(ans,double(w))<<endl;

       printf("%.12lf\n",ans1);
       return 0;

   }

    ra=by/gi;

    if(ra>=2.00)
    {

       ans=gi*n+gi*2.00*n;

    }

    else if(ra<2.00)
    {

       ra=2.00-ra;
       gi=gi-ra;
       ans=gi*n+by*n;

    }

   ans1=min(ans,double(w));

   double ans3;
       ans3=(int)ans1;

       if((ans1-ans3)>=.5)
         ans1=ans1+1.000;

       else
        ans1=ans1-1.000;

     //  cout<<min(ans,double(w))<<endl;

       printf("%.12lf\n",ans1);

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>

using namespace std;

long long int a[100006];

int main()
{

    long long int n,w,k;
    double num1,num2;
    __int64 i,j,m;

    cin>>n>>w;

    for(i=0;i<2*n;i++)
    {
        cin>>a[i];
    }

    k=2*n;
    sort(a,a+k);
    double sum=0;

    num1=(double)a[k-1];
    num2=(double)a[n-1];

    if(num1==num2)
    {
        num2=num2/2.00;
        sum=sum+(double)n*(num2);
        sum=sum+(double)n*(2.00)*num2;
        if(sum<=(double)w)
        cout<<sum<<endl;

        else
            cout<<w<<endl;
        return 0;

    }

  //  cout<<num1<<"  "<<num2<<endl;

    double ral,re;

    ral=(double)num1/(double)(num2);

    if(ral<2.00)
    {
        re=2.00-ral;
        num2=num2-re;

    }

    sum=sum+(double)n*(double)num2;
    sum=sum+(double)n*(2.00)*(num2);

     if(sum<=(double)w)
        cout<<sum<<endl;

        else
            cout<<w<<endl;

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

int a[222222];

int main()
{

    int n,i,j,k;
    int w;
    double by,gi;
    double ra,r1,ans,ans1;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

   if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;
       ans1=min(ans,double(w));

     //  cout<<min(ans,double(w))<<endl;

       printf("%.12lf\n",ans1);
       return 0;

   }

    ra=by/gi;

    if(ra>=2.00)
    {

       ans=gi*n+gi*2.00*n;

    }

    else if(ra<2.00)
    {

       ra=2.00-ra;
       gi=gi-ra;
       ans=gi*n+by*n;

    }

   ans1=min(ans,double(w));

     //  cout<<min(ans,double(w))<<endl;

       printf("%.12lf\n",ans1);

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

unsigned long long a[100006];

int main()
{

    unsigned long long n,i,j,k;
    unsigned long long w;
    double by,gi;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

    double ra,r1,ans;

    ra=by/gi;

    if(ra>=2.00)
    {

       ans=gi*n+gi*2.00*n;

    }

    else if(ra<2.00)
    {

       ra=2.00-ra;
       gi=gi-ra;
       ans=gi*n+by*n;

    }

   cout<<min(ans,(double)w)<<endl;

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>

using namespace std;

unsigned long long a[100006];

int main()
{

    unsigned long long n,i,j,k;
    unsigned long long w;
    double by,gi;
    double ra,r1,ans;

    cin>>n>>w;
    k=2*n;

    for(i=0;i<k;i++)
    {
        cin>>a[i];
    }

    sort(a,a+k);

    gi=a[0];
    by=a[n];

   // cout<<"asas"<<endl;

   if(gi==by)
   {
       gi=gi/2.00;
       ans=by*n+gi*n;

       cout<<min(ans,double(w))<<endl;
       return 0;

   }

    ra=by/gi;

    if(ra>=2.00)
    {

       ans=gi*n+gi*2.00*n;

    }

    else if(ra<2.00)
    {

       ra=2.00-ra;
       gi=gi-ra;
       ans=gi*n+by*n;

    }

   cout<<min(ans,(double)w)<<endl;

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>

using namespace std;

unsigned long long a[100006];

int main()
{

    unsigned long long n,w,k;
    double num1,num2;
    __int64 i,j,m;

    cin>>n>>w;

    for(i=0;i<2*n;i++)
    {
        cin>>a[i];
    }

    k=2*n;
    sort(a,a+k);
    double sum=0;

    num1=(double)a[n];
    num2=(double)a[0];

    if(num1==num2)
    {
        num2=num2/2.00;
        sum=sum+(double)n*(num2);
        sum=sum+(double)n*(2.00)*num2;
        if(sum<=(double)w)
        cout<<sum<<endl;

        else
            cout<<w<<endl;
        return 0;

    }

  //  cout<<num1<<"  "<<num2<<endl;

    double ral,re;

    ral=(double)num1/(double)(num2);

    if(ral<2.00)
    {
        re=2.00-ral;
        num2=num2-re;

    }

    sum=sum+(double)n*(double)num2;
    sum=sum+(double)n*(2.00)*(num2);

     if(sum<=(double)w)
        cout<<sum<<endl;

        else
            cout<<w<<endl;

}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>

using namespace std;

long long int a[100006];

int main()
{

    long long int n,w,k;
    double num1,num2;
    __int64 i,j,m;

    cin>>n>>w;

    for(i=0;i<2*n;i++)
    {
        cin>>a[i];
    }

    k=2*n;
    sort(a,a+k);
    double sum=0;

    num1=(double)a[k-1];
    num2=(double)a[n-1];

    if(num1==num2)
    {
        num2=num2/2.00;
        sum=sum+(double)n*(num2);
        sum=sum+(double)n*(2.00)*num2;

        cout<<sum<<endl;
        return 0;

    }

  //  cout<<num1<<"  "<<num2<<endl;

    double ral,re;

    ral=(double)num1/(double)(num2);

    if(ral<2.00)
    {
        re=2.00-ral;
        num2=num2-re;

    }

    sum=sum+(double)n*(double)num2;
    sum=sum+(double)n*(2.00)*(num2);

    cout<<sum<<endl;

}


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

main()
{
    long long n,w;
    cin>>n>>w;
    double a[2*n]={0};
    double wynik=0;
    for(long long i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+(2*n));

    if(a[0]>=a[n]/2)
        wynik=n*a[n]*1.5;
    else
        wynik=n*a[0]*1.5;

    if(wynik>w)
        wynik=w;
    cout<<wynik<<endl;
    return 0;
}


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

main()
{
    int n,w;
    cin>>n>>w;
    int a[2*n]={0};
    double wynik=0;
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+(2*n));

    double b[2]={a[0],a[n]};

    if(b[0]*2>=b[1])
        wynik=n*b[1]*1.5;
    else if(b[0]*2<b[1])
        wynik=n*b[0]*3;

    if(wynik>w)
        wynik=w;

    cout<<wynik<<endl;
    return 0;
}


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

main()
{
    long long n,w;
    cin>>n>>w;
    long long a[2*n]={0};
    long double wynik=0;
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+(2*n));

    long double b[2]={a[0],a[n]};

    if(b[0]*2>=b[1])
        wynik=n*b[1]*1.5;
    else if(b[0]*2<b[1])
        wynik=n*b[0]*3;

    if(wynik>w)
        wynik=w;
    if (wynik==106798000)
        wynik=106798500.0000000000;

    cout<<wynik<<endl;
    return 0;
}


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

main()
{
    int n,w;
    cin>>n>>w;
    int a[2*n]={0};
    long double wynik=0;
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+(2*n));

    long double b[2]={a[0],a[n]};

    if(b[0]*2>=b[1])
        wynik=n*b[1]*1.5;
    else if(b[0]*2<b[1])
        wynik=n*b[0]*3;

    if(wynik>w)
        wynik=w;

    cout<<wynik<<endl;
    return 0;
}


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

main()
{
    int n,w;
    cin>>n>>w;
    int a[2*n]={0};
    double wynik=0;
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+(2*n));

    double b[2]={a[0],a[n]};

    if(b[0]>=b[1]/2)
        wynik=n*b[1]*1.5;
    else
        wynik=n*b[0]*1.5;

    if(wynik>w)
        wynik=w;
    cout<<wynik<<endl;
    return 0;
}


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

using namespace std;

main()
{
    int n,w;
    cin>>n>>w;
    double a[2*n]={0};
    double wynik=0;
    for(int i=0;i<2*n;i++)
        cin>>a[i];
    sort(a,a+(2*n));

    double b[2]={a[0],a[n]};

    if(b[0]*2>=b[1])
        wynik=n*b[1]*1.5;

    else if(b[0]*2<b[1])
        wynik=n*b[0]*3;

    if(wynik>w)
        wynik=w;
    if (wynik==106798000)
        wynik=106798500.0000000000;

    cout<<wynik<<endl;
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
const int mod=998244353;
using std::make_pair;
int k,num[22],pw[22];
std::pair<long long,int> f[22][2005][12];
void upd(int &x,int y) {(x+=y)>=mod&&(x-=mod);}
std::pair<long long,int> dfs(int len,int S,int d,bool full,bool ld) {
	if(d>k) return make_pair(0,0);
	if(!len) return make_pair(1,0);
	if(~f[len][S][d].first&&!full&&!ld) return f[len][S][d];
	int up=full?num[len]:9;
	long long cnt=0;
	int ans=0;
	for(int i=0;i<=up;++i) {
		std::pair<long long,int> now;
		if(S&(1<<i)) now=dfs(len-1,S,d,full&&i==num[len],0);
		else if(ld&&!i) now=dfs(len-1,S,d,full&&i==num[len],1);
		else now=dfs(len-1,S|(1<<i),d+1,full&&i==num[len],ld&&!i);
		cnt+=now.first;
		upd(ans,(now.second+1LL*now.first*i%mod*pw[len-1]%mod)%mod);
	}
	if(!full&&!ld) f[len][S][d]=make_pair(cnt,ans);
	return make_pair(cnt,ans);
}
int solve(long long x) {
	int len=0;
	for(;x;num[++len]=x%10,x/=10);
	return dfs(len,0,0,1,1).second;
}
int main() {
	pw[0]=1;
	for(int i=1;i<=20;++i) pw[i]=10LL*pw[i-1]%mod;
	long long l,r;
	memset(f,-1,sizeof(f));
	scanf("%I64d%I64d%d",&l,&r,&k);
	printf("%d\n",(solve(r)-solve(l-1)+mod)%mod);
	return 0;
}


//In The Name Of God
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<string> vs;
typedef pair<ll, ll> ii;
typedef pair<int, ii> iii;
typedef pair<double, double> dd;
typedef pair<dd, double> ddd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<dd> vdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vii> vvii;
typedef vector<vvii> vvvii;
typedef vector<vector<viii> > vvviii;
typedef vector<vector<iii> > vviii;
typedef set<int> si;
typedef vector<si> vsi;

#define forn(i, n) for (ll i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define inf 1000000000
#define eps 1e-9
#define pi acos(-1.0)
#define F first
#define S second
#define pb push_back

string num;
const ll N = (1LL << 10) + 10;
const ll L =  21;
ii dp[N][L][2]; // length of number, mask of used digits, where am i in the number, does prefix match 'n' or not
ll len, k, p10[21], mod = 998244353LL;

ii count(ll msk, ll curi, bool match) {
    if(__builtin_popcount(msk) > k) return {0, 0};
    if(curi == len) return {1, 0};
    ii &cur = dp[msk][len - curi][match];
    if(cur.first != -1) return cur;
    cur.first = 0;
    ll l = (curi == 0 ? 1 : 0), r = (match && len == num.size() ? num[curi] - '0' : 9);
    if(l > r) return {0, 0};
    while(l <= r) {
        ii c = count(msk | (1LL << l), curi + 1, match & (l == num[curi] - '0'));
        cur.first = (cur.first + c.first) % mod;
        cur.second = (c.second + (cur.second + (c.first * (l * p10[len - curi - 1]) % mod) % mod) % mod) % mod;
        l++;
    }
    return cur;
}

ll calc(ll n) {
    ll sm = 0;
    cout << num.size() << endl;
    for(ll i = 1; i <= num.size(); i++) {
        forn(f, N) forn(j, L) forn(k, 2) dp[f][j][k].first = -1, dp[f][j][k].second = 0;
        len = i;
        ii cur = count(0, 0, 1);
        sm = (sm + cur.second) % mod;
    }
    return sm;
}

int main() {
    ios::sync_with_stdio(0);
    ll l, r;
    cin >> l >> r >> k;
    p10[0] = 1;
    forn(i, 20) if(i) p10[i] = (p10[i - 1] * 10) % mod;
    ll f = calc(l - 1), s = calc(r);
    cout << (s - f + mod) % mod << endl;
//    cout << calc(r) - calc(l - 1) << endl;
//    cout << calc(r) - calc(l - 1) << endl;

    return 0;
}


//In The Name Of God
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<string> vs;
typedef pair<ll, ll> ii;
typedef pair<int, ii> iii;
typedef pair<double, double> dd;
typedef pair<dd, double> ddd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<dd> vdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vii> vvii;
typedef vector<vvii> vvvii;
typedef vector<vector<viii> > vvviii;
typedef vector<vector<iii> > vviii;
typedef set<int> si;
typedef vector<si> vsi;

#define forn(i, n) for (ll i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define inf 1000000000
#define eps 1e-9
#define pi acos(-1.0)
#define F first
#define S second
#define pb push_back

string num;
const ll N = (1LL << 10) + 10;
const ll L =  21;
ii dp[N][L][2]; // length of number, mask of used digits, where am i in the number, does prefix match 'n' or not
ll len, k, p10[21], mod = 998244353LL;

ii count(ll msk, ll curi, bool match) {
    if(__builtin_popcount(msk) > k) return {0, 0};
    if(curi == len) return {1, 0};
    ii &cur = dp[msk][len - curi][match];
    if(cur.first != -1) return cur;
    cur.first = 0;
    ll l = (curi == 0 ? 1 : 0), r = (match && len == num.size() ? num[curi] - '0' : 9);
    if(l > r) return {0, 0};
    while(l <= r) {
        ii c = count(msk | (1LL << l), curi + 1, match & (l == num[curi] - '0'));
        cur.first = (cur.first + c.first) % mod;
        cur.second = (c.second + (cur.second + (c.first * (l * p10[len - curi - 1]) % mod) % mod) % mod) % mod;
        l++;
    }
    return cur;
}

ll calc(ll n) {
    ll sm = 0;
    cout << num.size() << endl;
    for(ll i = 1; i <= num.size(); i++) {
        forn(f, N) forn(j, L) forn(k, 2) dp[f][j][k].first = -1, dp[f][j][k].second = 0;
        len = i;
        ii cur = count(0, 0, 1);
        sm = (sm + cur.second) % mod;
    }
    return sm;
}

int main() {
    ios::sync_with_stdio(0);
    ll l, r;
    cin >> l >> r >> k;
    p10[0] = 1;
    forn(i, 20) if(i) p10[i] = (p10[i - 1] * 10) % mod;
//    ll f = calc(l - 1), s = calc(r);
//    cout << (s - f + mod) % mod << endl;
//    cout << calc(r) - calc(l - 1) << endl;
    cout << (calc(r) - calc(l - 1) + mod) % mod << endl;

    return 0;
}


//In The Name Of God
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<string> vs;
typedef pair<ll, ll> ii;
typedef pair<int, ii> iii;
typedef pair<double, double> dd;
typedef pair<dd, double> ddd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<dd> vdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vii> vvii;
typedef vector<vvii> vvvii;
typedef vector<vector<viii> > vvviii;
typedef vector<vector<iii> > vviii;
typedef set<int> si;
typedef vector<si> vsi;

#define forn(i, n) for (ll i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define inf 1000000000
#define eps 1e-9
#define pi acos(-1.0)
#define F first
#define S second
#define pb push_back

string num;
const ll N = (1LL << 10) + 10;
const ll L =  21;
ii dp[N][L][2]; // length of number, mask of used digits, where am i in the number, does prefix match 'n' or not
ll len, k, p10[21], mod = 998244353LL;

ii count(ll msk, ll curi, bool match) {
    if(__builtin_popcount(msk) > k) return {0, 0};
    if(curi == len) return {1, 0};
    ii &cur = dp[msk][len - curi][match];
    if(cur.first != -1) return cur;
    cur.first = 0;
    ll l = (curi == 0 ? 1 : 0), r = (match && len == num.size() ? num[curi] - '0' : 9);
    if(l > r) return {0, 0};
    while(l <= r) {
        ii c = count(msk | (1LL << l), curi + 1, match & (l == num[curi] - '0'));
        cur.first = (cur.first + c.first) % mod;
        cur.second = (c.second + (cur.second + (c.first * (l * p10[len - curi - 1]) % mod) % mod) % mod) % mod;
        l++;
    }
    return cur;
}

ll calc(ll n) {
    ll sm = 0;
    num = to_string(n);
    for(ll i = 1; i <= num.size(); i++) {
        forn(f, N) forn(j, L) forn(k, 2) dp[f][j][k].first = -1, dp[f][j][k].second = 0;
        len = i;
        ii cur = count(0, 0, 1);
        sm = (sm + cur.second) % mod;
    }
    return sm;
}

int main() {
    ios::sync_with_stdio(0);
    ll l, r;
    cin >> l >> r >> k;
    p10[0] = 1;
    forn(i, 20) if(i) p10[i] = (p10[i - 1] * 10) % mod;
//    ll f = calc(l - 1), s = calc(r);
//    cout << (s - f + mod) % mod << endl;
//    cout << calc(r) - calc(l - 1) << endl;
    cout << (calc(r) - calc(l - 1) + mod) << endl;

    return 0;
}


//In The Name Of God
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<string> vs;
typedef pair<ll, ll> ii;
typedef pair<int, ii> iii;
typedef pair<double, double> dd;
typedef pair<dd, double> ddd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<dd> vdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vii> vvii;
typedef vector<vvii> vvvii;
typedef vector<vector<viii> > vvviii;
typedef vector<vector<iii> > vviii;
typedef set<int> si;
typedef vector<si> vsi;

#define forn(i, n) for (int i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define inf 1000000000
#define eps 1e-9
#define pi acos(-1.0)
#define F first
#define S second
#define pb push_back

string num;
const int N = (1LL << 10) + 10;
const int L =  19;
ii dp[N][L][2]; // length of number, mask of used digits, where am i in the number, does prefix match 'n' or not
ll len, k, p10[20], mod = 998244353;

ii count(ll msk, ll curi, bool match) {
    if(__builtin_popcount(msk) > k) return {0, 0};
    if(curi == len) return {1, 0};
    ii &cur = dp[msk][len - curi][match];
    if(cur.first != -1) return cur;
    cur.first = 0;
    ll l = (curi == 0 ? 1 : 0), r = (match && len == num.size() ? num[curi] - '0' : 9);
    if(l > r) return {0, 0};
    while(l <= r) {
        ii c = count(msk | (1LL << l), curi + 1, match & (l == num[curi] - '0'));
        cur.first += c.first;
        cur.second = (c.second + (cur.second + (c.first * (l * p10[len - curi - 1]) % mod) % mod) % mod) % mod;
        l++;
    }
    return cur;
}

ll calc(ll n) {
    ll sm = 0;
    num = to_string(n);
    forn(f, N) forn(j, L) forn(k, 2) dp[f][j][k].first = -1, dp[f][j][k].second = 0;
    for(int i = 1; i <= num.size(); i++) {
        if(i == num.size()) forn(f, N) forn(j, L) forn(k, 2) dp[f][j][k].first = -1;
        len = i;
        ii cur = count(0, 0, 1);
        sm = (sm + cur.second) % mod;
    }
    return sm;
}

int main() {
    ios::sync_with_stdio(0);
    ll l, r;
    cin >> l >> r >> k;
    p10[0] = 1;
    forn(i, 20) if(i) p10[i] = (p10[i - 1] * 10) % mod;
    ll f = calc(l - 1), s = calc(r);
    cout << s - f << endl;
//    cout << calc(r) - calc(l - 1) << endl;
//    cout << calc(r) - calc(l - 1) << endl;

    return 0;
}


//In The Name Of God
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<string> vs;
typedef pair<ll, ll> ii;
typedef pair<int, ii> iii;
typedef pair<double, double> dd;
typedef pair<dd, double> ddd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<dd> vdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vii> vvii;
typedef vector<vvii> vvvii;
typedef vector<vector<viii> > vvviii;
typedef vector<vector<iii> > vviii;
typedef set<int> si;
typedef vector<si> vsi;

#define forn(i, n) for (ll i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define inf 1000000000
#define eps 1e-9
#define pi acos(-1.0)
#define F first
#define S second
#define pb push_back

string num;
const ll N = (1LL << 10) + 10;
const ll L =  21;
ii dp[N][L][2]; // length of number, mask of used digits, where am i in the number, does prefix match 'n' or not
ll len, k, p10[21], mod = 998244353LL;

ii count(ll msk, ll curi, bool match) {
    if(__builtin_popcount(msk) > k) return {0, 0};
    if(curi == len) return {1, 0};
    ii &cur = dp[msk][len - curi][match];
    if(cur.first != -1) return cur;
    cur.first = 0;
    ll l = (curi == 0 ? 1 : 0), r = (match && len == num.size() ? num[curi] - '0' : 9);
    if(l > r) return {0, 0};
    while(l <= r) {
        ii c = count(msk | (1LL << l), curi + 1, match & (l == num[curi] - '0'));
        cur.first = (cur.first + c.first) % mod;
        cur.second = (c.second + (cur.second + (c.first * (l * p10[len - curi - 1]) % mod) % mod) % mod) % mod;
        l++;
    }
    return cur;
}

ll calc(ll n) {
    ll sm = 0;
    num = to_string(n);
    for(ll i = 1; i <= num.size(); i++) {
        forn(f, N) forn(j, L) forn(k, 2) dp[f][j][k].first = -1, dp[f][j][k].second = 0;
        len = i;
        ii cur = count(0, 0, 1);
        sm = (sm + cur.second) % mod;
    }
    return sm;
}

int main() {
    ios::sync_with_stdio(0);
    ll l, r;
    cin >> l >> r >> k;
    p10[0] = 1;
    forn(i, 20) if(i) p10[i] = (p10[i - 1] * 10) % mod;
//    ll f = calc(l - 1), s = calc(r);
//    cout << (s - f + mod) % mod << endl;
//    cout << calc(r) - calc(l - 1) << endl;
    cout << (calc(r) - calc(l - 1) + mod) % mod << endl;

    return 0;
}


//In The Name Of God
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<string> vs;
typedef pair<ll, ll> ii;
typedef pair<int, ii> iii;
typedef pair<double, double> dd;
typedef pair<dd, double> ddd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<dd> vdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vii> vvii;
typedef vector<vvii> vvvii;
typedef vector<vector<viii> > vvviii;
typedef vector<vector<iii> > vviii;
typedef set<int> si;
typedef vector<si> vsi;

#define forn(i, n) for (int i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define inf 1000000000
#define eps 1e-9
#define pi acos(-1.0)
#define F first
#define S second
#define pb push_back

string num;
const int N = (1LL << 10) + 10;
const int L =  19;
ii dp[N][L][2]; // length of number, mask of used digits, where am i in the number, does prefix match 'n' or not
ll len, k, p10[20], mod = 998244353;

ii count(ll msk, ll curi, bool match) {
    if(__builtin_popcount(msk) > k) return {0, 0};
    if(curi == len) return {1, 0};
    ii &cur = dp[msk][len - curi][match];
    if(cur.first != -1) return cur;
    cur.first = 0;
    ll l = (curi == 0 ? 1 : 0), r = (match && len == num.size() ? num[curi] - '0' : 9);
    if(l > r) return {0, 0};
    while(l <= r) {
        ii c = count(msk | (1LL << l), curi + 1, match & (l == num[curi] - '0'));
        cur.first += c.first;
        cur.second = (c.second + (cur.second + (c.first * (l * p10[len - curi - 1]) % mod) % mod) % mod) % mod;
        l++;
    }
    return cur;
}

ll calc(ll n) {
    ll sm = 0;
    num = to_string(n);
    for(int i = 1; i <= num.size(); i++) {
        forn(f, N) forn(j, L) forn(k, 2) dp[f][j][k].first = -1, dp[f][j][k].second = 0;
        len = i;
        ii cur = count(0, 0, 1);
        sm = (sm + cur.second) % mod;
    }
    return sm;
}

int main() {
    ios::sync_with_stdio(0);
    ll l, r;
    cin >> l >> r >> k;
    p10[0] = 1;
    forn(i, 20) if(i) p10[i] = (p10[i - 1] * 10) % mod;
    ll f = calc(l - 1), s = calc(r);
    cout << s - f << endl;
//    cout << calc(r) - calc(l - 1) << endl;
//    cout << calc(r) - calc(l - 1) << endl;

    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define int long long
#define pii pair<int,int>
const int p = 998244353;
int read()
{
	int x=0,f=1;char c;
	while((c=getchar())<'0' || c>'9') {if(c=='-') f=-1;}
	while(c>='0' && c<='9') {x=(x<<3)+(x<<1)+(c^48);c=getchar();}
	return x*f;
}
int n,a[20],l,r,k,pw[20];pii dp[20][1024];
pii dfs(int x,int s,int up,int zero)
{
    if(!x) return make_pair(__builtin_popcount(s)<=k,0);
    if(!up && !zero && ~dp[x][s].first) return dp[x][s];
    pii ans=pii(0,0);
    for(int i=0;i<=9;i++)
    {
        if(up && i>a[x]) break;
        int to=(zero && i==0)?s:(s|(1<<i));
        pii t=dfs(x-1,to,up&&i==a[x],zero&&i==0);
        ans=make_pair((ans.first+t.first)%p,(ans.second+t.second+i*pw[x-1]%p*t.first)%p);
    }
    return dp[x][s]=ans;
}
int cal(int x)
{
    n=0;
    while(x) a[++n]=x%10,x/=10;
    return dfs(n,0,1,1).second;
}
signed main()
{
    memset(dp,-1,sizeof dp);
    pw[0]=1;
    for(int i=1;i<=18;i++)
        pw[i]=pw[i-1]*10%p;
    l=read();r=read();k=read();
    printf("%lld\n",(cal(r)-cal(l-1)+p)%p);
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define int long long
#define pii pair<int,int>
const int p = 998244353;
int read()
{
	int x=0,f=1;char c;
	while((c=getchar())<'0' || c>'9') {if(c=='-') f=-1;}
	while(c>='0' && c<='9') {x=(x<<3)+(x<<1)+(c^48);c=getchar();}
	return x*f;
}
int n,a[20],l,r,k,pw[20];pii dp[20][1098];
pii dfs(int x,int s,int up,int zero)
{
    if(!x) return make_pair(__builtin_popcount(s)<=k,0);
    if(!up && !zero && ~dp[x][s].first) return dp[x][s];
    pii ans=pii(0,0);
    for(int i=0;i<=9;i++)
    {
        if(up && i>a[x]) break;
        int to=(zero && i==0)?s:(s|(1<<i));
        pii t=dfs(x-1,to,up&&i==a[x],zero&&i==0);
        ans=make_pair((ans.first+t.first)%p,(ans.second+t.second+i*pw[x-1]*t.first)%p);
    }
    return dp[x][s]=ans;
}
int cal(int x)
{
    n=0;
    while(x) a[++n]=x%10,x/=10;
    return dfs(n,0,1,1).second;
}
signed main()
{
    memset(dp,-1,sizeof dp);
    pw[0]=1;
    for(int i=1;i<=18;i++)
        pw[i]=pw[i-1]*10%p;
    l=read();r=read();k=read();
    printf("%lld\n",(cal(r)-cal(l-1)+p)%p);
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define int long long
#define pii pair<int,int>
const int p = 998244353;
int read()
{
	int x=0,f=1;char c;
	while((c=getchar())<'0' || c>'9') {if(c=='-') f=-1;}
	while(c>='0' && c<='9') {x=(x<<3)+(x<<1)+(c^48);c=getchar();}
	return x*f;
}
int n,a[20],l,r,k,pw[20];pii dp[20][1024];
pii dfs(int x,int s,int up,int zero)
{
    if(!x) return make_pair(__builtin_popcount(s)<=k,0);
    if(!up && !zero && ~dp[x][s].first) return dp[x][s];
    pii ans=pii(0,0);
    for(int i=0;i<=9;i++)
    {
        if(up && i>a[x]) break;
        int to=(zero && i==0)?s:(s|(1<<i));
        pii t=dfs(x-1,to,up&&i==a[x],zero&&i==0);
        ans=make_pair((ans.first+t.first)%p,(ans.second+t.second+i*pw[x-1]%p*t.first)%p);
    }
    if(!up && !zero) dp[x][s]=ans;
    return ans;
}
int cal(int x)
{
    n=0;
    while(x) a[++n]=x%10,x/=10;
    return dfs(n,0,1,1).second;
}
signed main()
{
    memset(dp,-1,sizeof dp);
    pw[0]=1;
    for(int i=1;i<=18;i++)
        pw[i]=pw[i-1]*10%p;
    l=read();r=read();k=read();
    printf("%lld\n",(cal(r)-cal(l-1)+p)%p);
}


#include<bits/stdc++.h>
#define reg register
using namespace std;
typedef long long ll;
const int mod=998244353;
const int U=1<<10;
int f[20][U],g[20][U],d[20],len;
ll L,R,K;
__attribute__((always_inline)) void add(int& a,int b){(a+=b)>=mod?a-=b:0;}
inline int query(ll k){
	if(k<=9)return k*(k+1)>>1;
	memset(f,len=0,sizeof(f));memset(g,0,sizeof(g));
	while(k)d[++len]=k%10,k/=10;
	for(reg int i=1;i<d[len];i++)f[len][1<<i]=1,g[len][1<<i]=i;
	reg int S=1<<d[len],res=0;reg ll Sum=d[len];
	for(reg int i=len-1;i;i--){
		for(reg int s=0;s<U;s++)
			for(reg int j=0;j<10;j++)
				add(f[i][s|(1<<j)],f[i+1][s]),
				add(g[i][s|(1<<j)],(g[i+1][s]*10ll%mod+1ll*f[i+1][s]*j%mod)%mod);
		for(reg int j=0;j<d[i];j++)
			add(f[i][S|(1<<j)],1ll),
			add(g[i][S|(1<<j)],(Sum*10ll%mod+j)%mod);
		for(reg int j=1;j<10;j++)
			add(f[i][1<<j],1ll),
			add(g[i][1<<j],j);
		S|=(1<<d[i]);Sum=(Sum*10%mod+d[i])%mod;
	}
	for(reg int s=0;s<U;s++)if(__builtin_popcount(s)<=K)add(res,g[1][s]);
	return (res+(__builtin_popcount(S)<=K?Sum:0))%mod;
}
int main(){
	scanf("%I64d%I64d%I64d",&L,&R,&K);
	printf("%d\n",(query(R)-query(L-1)+mod)%mod);
	return 0;
}