#include <iostream>
using namespace std;
int main ()
{
	int sh=1,n,a[1000],c1,c2,max,min;
	cin>>n;
	for (int i=0; i<n; i++)
		cin>>a[i];

	max=a[0];
	min=max;
	c2=0;
	c1=0;
	for (int i=0; i<n; i++)
	{
		if (max<a[i])
		{
			max=a[i];
			c1=i;
		}
		if (min>=a[i])
		{
			min=a[i];
			c2=i;
		}
	}

	if (c1>c2)
		cout<<c1+(n-2-c2);
	else
		cout<<c1+(n-1-c2);
	cin>>sh;
	return 0;

}


#include <iostream>
using namespace std;
int main ()
{
	int sh=1,n,a[1000],counter=0;
	cin>>n;
	for (int i=0; i<n; i++)
		cin>>a[i];
	while (sh!=0)
	{
		sh=counter;
		for (int i=1; i<n; i++)
			if (a[i]>a[i-1])
			{
				swap(a[i],a[i-1]);
				counter++;
			}
		if (sh==counter)
		{
			cout<<counter;
			cin>>counter;
			return 0;
		}
	}
}


#include <iostream>
using namespace std;
int main ()
{
	int sh=1,n,a[1000],c1,c2,max,min;
	cin>>n;
	for (int i=0; i<n; i++)
		cin>>a[i];

	max=a[0];
	min=max;

	for (int i=0; i<n; i++)
	{
		if (max<=a[i])
		{
			max=a[i];
			c1=i;
		}
		if (min>=a[i])
		{
			min=a[i];
			c2=i;
		}
	}
	if (c1>c2)
		cout<<c1+(n-1-c2)-1;
	else
		cout<<c2+(n-2-c1);
	cin>>sh;
	return 0;

}


#include <iostream>
using namespace std;

void swap(int &x,int &y)
{int temp=x;   x=y; y=temp;}

void main()
{int n,smallest,largest,sec=0;
cin>>n;
int *arr=new int[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
smallest=largest=0;
for(int i=1;i<n;i++)
    if(arr[i]<=arr[smallest])
      smallest=i;

if(arr[smallest]!=arr[n-1])
for(int i=smallest+1;i<n;i++)
{swap(arr[i],arr[i-1]); sec++;}

for(int i=1;i<n;i++)
     if(arr[i]>=arr[largest])
         largest=i;

if(arr[largest]!=arr[0])

    for(int i=largest-1;i>=0;i--)
{swap(arr[i],arr[i+1]); sec++;}

cout<<sec;
}


#include <iostream>
using namespace std;

void swap(int &x,int &y)
{int temp=x;   x=y; y=temp;}

void main()
{int n,smallest,largest,sec=0;
cin>>n;
int *arr=new int[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
smallest=largest=0;
for(int i=1;i<n;i++)
    if(arr[i]<=arr[smallest])
      smallest=i;

if(arr[smallest]!=arr[n-1])
for(int i=smallest+1;i<n;i++)
{swap(arr[i],arr[i-1]); sec++;}

for(int i=n-1;i>=0;i--)
     if(arr[i]>=arr[largest])
         largest=i;

if(arr[largest]!=arr[0])

    for(int i=largest-1;i>=0;i--)
{swap(arr[i],arr[i+1]); sec++;}

cout<<sec;
}


#include <iostream>
using namespace std;

void swap(int &x,int &y)
{int temp=x;   x=y; y=temp;}

void main()
{int n,smallest,largest,sec=0;
cin>>n;
int *arr=new int[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
smallest=largest=0;
for(int i=1;i<n;i++)
    if(arr[i]<=arr[smallest])
      smallest=i;

for(int i=smallest+1;i<n;i++)
{swap(arr[i],arr[i-1]); sec++;}

for(int i=1;i<n;i++)
     if(arr[i]>=arr[largest])
         largest=i;

for(int i=largest-1;i>=0;i--)
{swap(arr[i],arr[i+1]); sec++;}

cout<<sec;
}


#include <iostream>
using namespace std;

void swap(int &x,int &y)
{int temp=x;   x=y; y=temp;}

void main()
{int n,smallest,largest,sec=0;
cin>>n;
int *arr=new int[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
smallest=largest=0;
for(int i=1;i<n;i++)
    if(arr[i]<=arr[smallest])
      smallest=i;

if(arr[smallest]!=arr[n-1])
for(int i=smallest+1;i<n;i++)
{swap(arr[i],arr[i-1]); sec++;}

for(int i=n-2;i>=n;i--)
     if(arr[i]>=arr[largest])
         largest=i;

if(arr[largest]!=arr[0])

    for(int i=largest-1;i>=0;i--)
{swap(arr[i],arr[i+1]); sec++;}

cout<<sec;
}


#include <iostream>
using namespace std;

void swap(int &x,int &y)
{int temp=x;   x=y; y=temp;}

void main()
{int n,smallest,largest,sec=0;
cin>>n;
int *arr=new int[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
smallest=largest=0;
for(int i=1;i<n;i++)
    {if(arr[i]<=arr[smallest])
      smallest=i;
     if(arr[i]>=arr[largest])
         largest=i;}

for(int i=smallest+1;i<n;i++)
{swap(arr[i],arr[i-1]); sec++;}

for(int i=largest-1;i>=0;i--)
{swap(arr[i],arr[i+1]); sec++;}

cout<<sec;
}


//#include "A.h"
//#include "B.h"
//#include "C.h"
//#include "D.h"
//#include "E.h"

#include <iostream>
using namespace std;

#include <vector>
#include <algorithm>

void main()
{
    int n;
    cin>>n;
    vector<int> v(n,0);
    int max = -1;
    int min = 101;
    for(int q=0; q<n; q++)
    {
        scanf("%d", &v[q]);
        if(max < v[q])
            max = v[q];
        if(min > v[q])
            min = v[q];
    }

    if(v[0] == max && v[n-1] == min)
        cout<<0<<endl;

    int result = 0;

    for(int q=0; q<n; q++, result++)
    {
        if(v[q] == max)
        {
            for(int w=q; w>0; w--)
                swap(v[w], v[w-1]);
            break;
        }
    }

    for(int q=n-1; q>=0; q--, result++)
    {
        if(v[q] == min)
            break;
    }

    cout<<result<<endl;
}


//#include "A.h"
//#include "B.h"
//#include "C.h"
//#include "D.h"
//#include "E.h"

#include <iostream>
using namespace std;

#include <vector>
#include <algorithm>

void main()
{
    int n;
    cin>>n;
    vector<int> v(n,0);
    int max = -1;
    int min = 101;
    for(int q=0; q<n; q++)
    {
        scanf("%d", &v[q]);
        if(max < v[q])
            max = v[q];
        if(min > v[q])
            min = v[q];
    }

    if(v[0] == max && v[n-1] == min)
        cout<<0<<endl;

    int result = 0;

    int index;

    for(int q=0; q<n; q++,result++)
    {
        if(v[q] == max)
        {
            index = q;
            swap(v[0], v[q]);
            break;
        }
    }

    for(int q=n-1; q>=0; q--,result ++)
    {
        if(v[q] == min)
        {
            //if(q <= index)
            //  result--;

            break;
        }
    }
    cout<<result<<endl;
}


//#include "A.h"
//#include "B.h"
//#include "C.h"
//#include "D.h"
//#include "E.h"

#include <iostream>
using namespace std;

#include <vector>
#include <algorithm>
#include <math.h>

void main()
{
    int n;
    cin>>n;
    vector<int> v(n,0);

    int min = 1000,
        max = -1000;

    for(int q=0; q<n; q++)
    {
        scanf("%d", &v[q]);
        if(v[q] < min)
            min = v[q];
        if(v[q] > max)
            max = v[q];
    }

    int result = 0,
        index;

    for(int q=0; q<n; q++, result++)
    {
        if(v[q] == max)
        {
            index = q;
            break;
        }
    }

    for(int q=n-1; q>=0; q--, result++)
    {
        if(v[q] == min)
        {
            if(q <= index)
                result--;
            break;
        }
    }

    cout<<result<<endl;
}


//#include "A.h"
//#include "B.h"
//#include "C.h"
//#include "D.h"
//#include "E.h"

#include <iostream>
using namespace std;

#include <vector>

void main()
{
    int n;
    cin>>n;
    vector<int> v(n,0);
    int max = -1;
    int min = 101;
    for(int q=0; q<n; q++)
    {
        scanf("%d", &v[q]);
        if(max < v[q])
            max = v[q];
        if(min > v[q])
            min = v[q];
    }

    if(v[0] == max && v[n-1] == min)
        cout<<0<<endl;

    int result = 0;

    int index;

    for(int q=0; q<n; q++,result++)
    {
        if(v[q] == max)
        {
            index = q;
            break;
        }
    }

    for(int q=n-1; q>=0; q--,result ++)
    {
        if(v[q] == min)
        {
            if(q <= index)
                result--;
            break;
        }
    }
    cout<<result<<endl;
}


#include <iostream>
using namespace std;
int main()
{
  int n,a[100],count1=0,maxi,mini,a_1,a_2;
  cin>>n;
  for(int i=0;i<n;i++)
cin>>a[i];
maxi=a[0];mini=a[0];
for(int i=0;i<n;i++)
{if(a[i]>=maxi)maxi=a[i];
if(a[i]<=mini)mini=a[i];
}
if(a[0]==maxi&&a[n-1]==mini)count1=0;
else{
for(int i=0;i<n;i++)
{if(a[i]==mini)a_1=i;
if(a[i]==maxi)a_2=i;
}
for(int i=a_1;i<n-1;i++)
{if(a[i]<a[i+1])
{swap(a[i],a[i+1]);count1++;}}
for(int i=a_2;i>=1;i--)
if(a[i]>a[i-1])
{swap(a[i],a[i-1]);count1++;
}}
cout<<count1<<endl;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
int n,x[100],f=0;
cin>>n;
for(int i=0;i<n;i++)
cin>>x[i];
for(int i=0;i<n-1;i++){
if(x[i]==x[i+1])f++;
}
if(n==1)f=1;
cout<<f<<endl;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
  int n,a[100],count1=0,maxi,mini,a_1=0,a_2=0;
  cin>>n;
  for(int i=0;i<n;i++)
cin>>a[i];
maxi=a[0];mini=a[0];
for(int i=0;i<n;i++)
{if(a[i]>=maxi)maxi=a[i];
if(a[i]<=mini)mini=a[i];
}
if(a[0]==maxi&&a[n-1]==mini)count1=0;
else{
for(int i=0;i<n;i++)
{if(a[i]==maxi){a_2=i;break;}}
for(int i=n-1;i>=0;i--)
{if(a[i]==mini){a_1=i;break;}}
for(int i=a_1;i<n-1;i++)
{if(a[i]<a[i+1])
{swap(a[i],a[i+1]);count1++;}}
for(int i=a_2;i>=1;i--)
if(a[i]>a[i-1])
{swap(a[i],a[i-1]);count1++;
}}
cout<<count1<<endl;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
  int n,a[100],count1=0;
  cin>>n;
  for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n-1;i++)
{if(a[i]<a[i+1])
{swap(a[i],a[i+1]);count1++;}}
for(int i=n-2;i>=1;i--)
if(a[i]>a[i-1])
{swap(a[i],a[i-1]);count1++;
}
cout<<count1<<endl;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
  int n,a[100],count1=0,maxi,mini,a_1,a_2;
  cin>>n;
  for(int i=0;i<n;i++)
cin>>a[i];
maxi=a[0];mini=a[0];
for(int i=0;i<n;i++)
{if(a[i]>=maxi)maxi=a[i];
if(a[i]<=mini)mini=a[i];
}
if(a[0]==maxi&&a[n-1]==mini)count1=0;
else{
for(int i=0;i<n;i++)
{if(a[i]==maxi)a_2=i;}
for(int i=n-1;i>=0;i++)
{if(a[i]==mini)a_1=i;}
for(int i=a_1;i<n-1;i++)
{if(a[i]<a[i+1])
{swap(a[i],a[i+1]);count1++;}}
for(int i=a_2;i>=1;i--)
if(a[i]>a[i-1])
{swap(a[i],a[i-1]);count1++;
}}
cout<<count1<<endl;
    return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int size;
	cin>>size;
	int *arr=new int [size];
	for (int i=0;i<size;i++)
	cin>>arr[i];
	int mini=0,max=0;
	for (int i=1;i<size;i++)
	{
		if (arr[i]>arr[max])
		max=i;
		if (arr[i]<arr[mini])
		mini=i;

	}
	if(size==2)
	cout<<1<<endl;
	if(max>mini)
	cout<<max+(size-mini)-2<<endl;
	else
	cout<<max+(size-mini)-1<<endl;
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int size;
	cin>>size;
	int *arr=new int [size];
	for (int i=0;i<size;i++)
	cin>>arr[i];
	int mini=0,max=0;
	for (int i=1;i<size;i++)
	{
		if (arr[i]>arr[max])
		max=i;
		if (arr[i]<arr[mini])
		mini=i;

	}
	if(size==2)
	cout<<1<<endl;
	if(max>=mini)
	cout<<max+(size-mini)-2<<endl;
	else
	cout<<max+(size-mini)-1<<endl;
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int size;
	cin>>size;
	int *arr=new int [size];
	for (int i=0;i<size;i++)
	cin>>arr[i];
	int mini=0,max=0;
	for (int i=1;i<size;i++)
	{
		if (arr[i]>arr[max])
		max=i;
		if (arr[i]<=arr[mini])
		mini=i;

	}
	if(max>mini)
	cout<<max+(size-mini)-2<<endl;
	else
	cout<<max+(size-mini)-1<<endl;
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int size;
	cin>>size;
	int *arr=new int [size];
	for (int i=0;i<size;i++)
	cin>>arr[i];
	int mini=0,max=0;
	for (int i=1;i<size;i++)
	{
		if (arr[i]>arr[max])
		max=i;
		if (arr[i]<=arr[mini])
		mini=i;

	}
	if(size==2)
	cout<<1<<endl;
	if(max>mini)
	cout<<max+(size-mini)-2<<endl;
	else
	cout<<max+(size-mini)-1<<endl;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
int n ;
cin>>n;
int a[100];
for(int i=0 ; i<n ; i++)
{
	cin>>a[i];
}
int max=0 , mx=0 , cunt=0;

for(int i=0 ; i<n ; i++)
{
	if(a[i]>max)
	{
		max=a[i];
		mx=i;
	}
}
cunt+=mx ;
int mini=100 , mn=0;
for(int i=0 ; i<n ; i++)
{
	if(a[i]<=mini)
	{
		mini=a[i];
		mn=i;
	}
}
if(mx>mn)
{--cunt;}
cunt+=(n-1-mn);
cout<<cunt<<endl;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
int n ;
cin>>n;
int a[100];
for(int i=0 ; i<n ; i++)
{
	cin>>a[i];
}
int max=0 , mx=0 , cunt=0;

for(int i=0 ; i<n ; i++)
{
	if(a[i]>max)
	{
		max=a[i];
		mx=i;
	}
}
cunt+=mx ;
int mini=100 , mn=0;
for(int i=0 ; i<n ; i++)
{
	if(a[i]<mini)
	{
		mini=a[i];
		mn=i;
	}
}
cunt+=(n-mn-1);
if(mx>mn)
{
	--cunt;
}
cout<<cunt<<endl;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
int n ;
cin>>n;
int a[100];
for(int i=0 ; i<n ; i++)
{
	cin>>a[i];
}
int max=0 , mx=0 , cunt=0;

for(int i=0 ; i<n ; i++)
{
	if(a[i]>max)
	{
		max=a[i];
		mx=i;
	}
}
cunt+=mx ;
int mini=100 , mn=0;
for(int i=0 ; i<n ; i++)
{
	if(a[i]<mini)
	{
		mini=a[i];
		mn=i;
	}
}
if(mx>mn)
{--cunt;}
cunt+=(n-1-mn);
cout<<cunt<<endl;
	return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int size;
	cin>>size;
	int *arr=new int [size];
	for (int i=0;i<size;i++)
	cin>>arr[i];
	int mini=0,max=0;
	for (int i=1;i<size;i++)
	{
		if (arr[i]>arr[max])
		max=i;
		if (arr[i]<=arr[mini])
		mini=i;

	}
	if(size==2)
	cout<<1<<endl;
	else if(max>mini)
	cout<<max+(size-mini)-2<<endl;
	else
	cout<<max+(size-mini)-1<<endl;
	return 0;
}


#include<iostream>
using namespace std;
int main()
 {
	long long int n, i, a[100], count = 0, min, max, j, k;
	cin >> n;
	for (i = 1; i <= n; i++)
		cin >> a[i];

		min = a[1];
		max = a[1];
		k = 1;

	for (i = 1; i <= n; i++)
	{
		if (a[i] <= min)
		{
			min = a[i];
			j = i;
		}
		if (a[i]>max)
		{
			max = a[i];
			k = i;
		}
	}
	//cout<<j<<" "<<k<<endl;
	if (j>k)
		count = (n - j) + (k - 1);
	else if (j == n && k == 1)
		count = 0;
	else
		count = (n - j) + (k - 1) - 1;
	cout << count << endl;
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
 {
	long long int n, i, a[100], count = 0, min, max, j, k;
	cin >> n;
	for (i = 1; i <= n; i++)
		cin >> a[i];

		min = a[1];
		max = a[1];
		k = 1;

	for (i = 1; i <= n; i++)
	{
		if (a[i] <= min)
		{
			min = a[i];
			j = i;
		}
		if (a[i]>max)
		{
			max = a[i];
			k = i;
		}
	}
	//cout<<j<<" "<<k<<endl;
	if (j>k)
		count = (n - j) + (k - 1);
	else if (j == n && k == 1)
		count = 0;
	else
		count = (n - j) + (k - 1) - 1;
	cout << count << endl;
		return 0;
}


#include<iostream>
using namespace std;
int main()
 {
	long long int n, i, a[101], count = 0, min, max, j, k;
	cin >> n;
	for (i = 1; i <= n; i++)
		cin >> a[i];

		min = a[1];
		max = a[1];
		k = 1;

	for (i = 1; i <= n; i++)
	{
		if (a[i] <= min)
		{
			min = a[i];
			j = i;
		}
		if (a[i]>max)
		{
			max = a[i];
			k = i;
		}
	}
	//cout<<j<<" "<<k<<endl;
	if (j>k)
		count = (n - j) + (k - 1);
	else if (j == n && k == 1)
		count = 0;
	else
		count = (n - j) + (k - 1) - 1;
	cout << count << endl;
		return 0;
}


#include<iostream>

using namespace std;

int main()
{
	int n, count = 0;
	cin >> n;
	int *m = new int[n];
	for (int i = 0; i < n; i++)
	{
		cin >> m[i];
	}
	for (int i = 0; i < n; i++)
	{
		if (m[i + 1] > m[i])
		{
			int t = m[i + 1];
			m[i + 1] = m[i];
			m[i] = t;
			count++;
		}
	}
	for (int i = 0; i < n; i++)
	{
		if (m[i + 1] > m[i])
		{
			int t = m[i + 1];
			m[i + 1] = m[i];
			m[i] = t;
			count++;
		}
	}
	cout << count << endl;
	delete[]m;
		return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cctype>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long

int main(){
    //freopen("input.in", "r", stdin);
    //freopen("input.out", "w", stdout);

    int n;
    cin >> n;

    vector<int> a;
    int minn = 1E9;
    int maxx = -1;
    int maxxind = 101, minnind = -1;
    for (int i = 1; i <= n; i++){
        int t;
        cin >> t;
        a.push_back(t);

        if (maxx < t){
            maxx = t;
            maxxind = i;
        }

        if (minn > t){
            minn = t;
            minnind = i;
        }

        if (maxx == t){
            if (maxxind > i)
                maxxind = i;
        }

        if (minn == t){
            if (minnind > i)
                minnind = i;
        }

    }

    if(maxxind == 1 && minnind == n){
        cout<<<0;
        return 0;
    }

    if(maxxind < minnind){
        cout<<maxxind-1+n-minnind;
    }
    else{
        cout<<maxxind-1+n-minnind-2;
    }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cctype>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long

int main(){
    //freopen("input.in", "r", stdin);
    //freopen("input.out", "w", stdout);

    int n;
    cin >> n;

    vector<int> a;
    int minn = 1E9;
    int maxx = -1;
    int maxxind = 101, minnind = -1;
    for (int i = 1; i <= n; i++){
        int t;
        cin >> t;
        a.push_back(t);

        if (maxx < t){
            maxx = t;
            maxxind = i;
        }

        if (minn > t){
            minn = t;
            minnind = i;
        }

        if (maxx == t){
            if (maxxind > i)
                maxxind = i;
        }

        if (minn == t){
            if (minnind > i)
                minnind = i;
        }

    }

    if(maxxind == 1 && minnind == n){
        cout<<0;
        return 0;
    }

    maxxind--; minnind--;

    int s=0;
    s+=(n-minnind-1);
    if (minnind<maxxind) s+=(maxxind-1); else s+=maxxind;

    cout<<s;

    return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,tmp;
cin>>n>>tmp;
int max=tmp,min=tmp;
int imin=0,imax=0;
int res=0;

for(int i=1;i<n;i++)
{
cin>>tmp;
if(tmp>max){max=tmp;imax=i;}
if(tmp<=min){min=tmp;imin=i;}
}

res=n-imin-1;
if(imax>imin)
    res+=imax-1;
else
    res+=imax;

cout<<res;
return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cctype>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long

int main(){
    //freopen("input.in", "r", stdin);
    //freopen("input.out", "w", stdout);

    int n;
    cin >> n;

    vector<int> a;
    int minn = 1E9;
    int maxx = -1;
    int maxxind = 101, minnind = -1;
    for (int i = 1; i <= n; i++){
        int t;
        cin >> t;
        a.push_back(t);

        if (maxx < t){
            maxx = t;
            maxxind = i;
        }

        if (minn > t){
            minn = t;
            minnind = i;
        }

        if (maxx == t){
            if (maxxind > i)
                maxxind = i;
        }

        if (minn == t){
            if (minnind > i)
                minnind = i;
        }

    }

    if(maxxind < minnind){
        cout<<maxxind-1+n-minnind;
    }
    else{
        cout<<maxxind-1+n-minnind-2;
    }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cctype>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long

int main(){
    //freopen("input.in", "r", stdin);
    //freopen("input.out", "w", stdout);

    int n;
    cin >> n;

    vector<int> a;
    int minn = 1E9;
    int maxx = -1;
    int maxxind = 101, minnind = -1;
    for (int i = 1; i <= n; i++){
        int t;
        cin >> t;
        a.push_back(t);

        if (maxx < t){
            maxx = t;
            maxxind = i;
        }

        if (minn > t){
            minn = t;
            minnind = i;
        }

        if (maxx == t){
            if (maxxind > i)
                maxxind = i;
        }

        if (minn == t){
            if (minnind > i)
                minnind = i;
        }

    }

    if(maxxind == 1 && minnind == n){
        cout<<0;
        return 0;
    }

    if(maxxind < minnind){
        cout<<maxxind-1+n-minnind;
    }
    else{
        cout<<maxxind-1+n-minnind-2;
    }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cctype>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long

int main(){
    //freopen("input.in", "r", stdin);
    //freopen("input.out", "w", stdout);

    int n;
    cin >> n;

    vector<int> a;
    int minn = 1E9;
    int maxx = -1;
    int maxxind = 101, minnind = -1;
    for (int i = 1; i <= n; i++){
        int t;
        cin >> t;
        a.push_back(t);

        if (maxx < t){
            maxx = t;
            maxxind = i;
        }

        if (minn > t){
            minn = t;
            minnind = i;
        }

    }

    if(maxxind == 1 && minnind == n){
        cout<<0;
        return 0;
    }

    int s=0;
    s+=(n-minnind-1);
    if (minnind<maxxind) s+=(maxxind-1); else s+=maxxind;

    cout<<s;

    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cctype>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long

int main(){
    //freopen("input.in", "r", stdin);
    //freopen("input.out", "w", stdout);

    int n;
    cin >> n;

    vector<int> a;
    int minn = 1E9;
    int maxx = -1;
    int maxxind = 101, minnind = -1;
    for (int i = 1; i <= n; i++){
        int t;
        cin >> t;
        a.push_back(t);

        if (maxx < t){
            maxx = t;
            maxxind = i;
        }

        if (minn > t){
            minn = t;
            minnind = i;
        }

        if (maxx == t){
            if (maxxind > i)
                maxxind = i;
        }

        if (minn == t){
            if (minnind > i)
                minnind = i;
        }

    }

    if(maxxind == 1 && minnind == n){
        cout<<0;
        return 0;
    }

    maxxind--; minnind--;

    if(maxxind < minnind){
        cout<<maxxind-1+n-minnind;
    }
    else{
        cout<<maxxind-1+n-minnind-1;
    }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cctype>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long

int main(){
    //freopen("input.in", "r", stdin);
    //freopen("input.out", "w", stdout);

    int n;
    cin >> n;

    vector<int> a;
    int minn = 1E9;
    int maxx = -1;
    int maxxind = 0, minnind = 0;
    for (int i = 1; i <= n; i++){
        int t;
        cin >> t;
        a.push_back(t);

        if (maxx < t){
            maxx = t;
            maxxind = i;
        }

        if (minn > t){
            minn = t;
            minnind = i;
        }

    }

    if(maxxind == 1 && minnind == n){
        cout<<0;
        return 0;
    }

    int s=0;
    s+=(n-minnind-1);
    if (minnind<maxxind) s+=(maxxind-1); else s+=maxxind;

    cout<<s;

    return 0;
}


#include<iostream>
#include<cmath>
#include <iomanip>
#include<string>
#include<map>
#include<cctype>
#include <algorithm>
using namespace std;
int main()
{
  int t, x , w , n;
  map<string ,int> m;
  map < string , int  > :: iterator it ;
  cin>>t;
  //--t;
  cin>>x;
  m["max"]=m["min"]=x;
  m["XL"]=m["NL"]=1;
 for(int i=2; i<t ; i++)
 {
     cin>>x;
    // m[i]=x;
     if(m["max"]<x)
     {  m["max"]=x;     m["XL"]=i;}
      if(m["min"]>=x)
     {  m["min"]=x;     m["NL"]=i;  }

 }
 //cout<<m["NL"]<<"  "<<m["XL"]<<endl;
    if(m["NL"]>m["XL"])
    {   w=m["XL"]+(t-m["NL"]-1); }
    else {  w=m["XL"]+(t-m["NL"])-1; }

    cout<<w;
 //for ( it = m3.begin() ; it!=m3.end() ;it++)
    return 0;

}//http://codeforces.com/contest/144/submission/10142710


#include<iostream>
#include<cmath>
#include <iomanip>
#include<string>
#include<map>
#include<cctype>
#include <algorithm>
using namespace std;
int main()
{
  int t, x , w , n;
  map<string ,int> m;
  map < string , int  > :: iterator it ;
  cin>>t;
  //--t;
  cin>>x;
  m["max"]=m["min"]=x;
  m["XL"]=m["NL"]=1;
 for(int i=2; i<=t ; i++)
 {
     cin>>x;
    // m[i]=x;
     if(m["max"]<x)
     {  m["max"]=x;     m["XL"]=i;}
      if(m["min"]>=x)
     {  m["min"]=x;     m["NL"]=i;  }

 }
// cout<<m["NL"]<<"  "<<m["XL"]<<endl;
    if(m["NL"]>m["XL"])
    {   w=m["XL"]+(t-m["NL"]-1); }
    else {  w=m["XL"]+(t-m["NL"])-2; }

    cout<<w;
 //for ( it = m3.begin() ; it!=m3.end() ;it++)
    return 0;

}//http://codeforces.com/contest/144/submission/10142710


#include<iostream>
#include<cmath>
#include <iomanip>
#include<string>
#include<map>
#include<cctype>
#include <algorithm>
using namespace std;
int main()
{
  int t, x , w , n;
  map<string ,int> m;
  map < string , int  > :: iterator it ;
  cin>>t;
  //--t;
  cin>>x;
  m["max"]=m["min"]=x;
  m["XL"]=m["NL"]=1;
 for(int i=2; i<t ; i++)
 {
     cin>>x;
    // m[i]=x;
     if(m["max"]<x)
     {  m["max"]=x;     m["XL"]=i;}
      if(m["min"]>=x)
     {  m["min"]=x;     m["NL"]=i;  }

 }
// cout<<m["NL"]<<"  "<<m["XL"]<<endl;
    if(m["NL"]>m["XL"])
    {   w=m["XL"]+(t-m["NL"])-1; }
    else {  w=m["XL"]+(t-m["NL"]); }

    cout<<w;
 //for ( it = m3.begin() ; it!=m3.end() ;it++)
    return 0;

}


#include<iostream>
#include<cmath>
#include <iomanip>
#include<string>
#include<map>
#include<cctype>
#include <algorithm>
using namespace std;
int main()
{
  int t, x , w , n;
  map<string ,int> m;
  map < string , int  > :: iterator it ;
  cin>>t;
  //--t;
  cin>>x;
  m["max"]=m["min"]=x;
  m["XL"]=m["NL"]=1;
 for(int i=2; i<=t ; i++)
 {
     cin>>x;
    // m[i]=x;
     if(m["max"]<x)
     {  m["max"]=x;     m["XL"]=i;}
      if(m["min"]>=x)
     {  m["min"]=x;     m["NL"]=i;  }

 }
 cout<<m["NL"]<<"  "<<m["XL"]<<endl;
    if(m["NL"]>m["XL"])
    {   w=m["XL"]+(t-m["NL"]-1); }
    else {  w=m["XL"]+(t-m["NL"])-2; }

    cout<<w;
 //for ( it = m3.begin() ; it!=m3.end() ;it++)
    return 0;

}//http://codeforces.com/contest/144/submission/10142710


#include<iostream>
#include<cmath>
#include <iomanip>
#include<string>
#include<map>
#include<cctype>
#include <algorithm>
using namespace std;
int main()
{
  int t, x , w , n;
  map<string ,int> m;
  map < string , int  > :: iterator it ;
  cin>>t;
  //--t;
  cin>>x;
  m["max"]=m["min"]=x;
  m["XL"]=m["NL"]=1;
 for(int i=2; i<t ; i++)
 {
     cin>>x;
    // m[i]=x;
     if(m["max"]<x)
     {  m["max"]=x;     m["XL"]=i;}
      if(m["min"]>=x)
     {  m["min"]=x;     m["NL"]=i;  }

 }
// cout<<m["NL"]<<"  "<<m["XL"]<<endl;
    if(m["NL"]>m["XL"])
    {   w=m["XL"]+(t-m["NL"])-1; }
    else {  w=m["XL"]+(t-m["NL"])-1; }

    cout<<w;
 //for ( it = m3.begin() ; it!=m3.end() ;it++)
    return 0;

}


#include <iostream>

using namespace std;

int main()
{
    int n = 0, m = 0, min = 100, max = 0, a = 0, b = 0, i = 0;
    cin >> n;
    while (cin >> m)
    {
        i++;
        if (m > max)
        {
            max = m;
            a = i;
        }
        if (m < min)
        {
            min = m;
            b = i;
        }
    }
    m = a - 1 + n - b;
    if (a > b)
    {
        m -= 2;
        if (n == 2)
        {
            m++;
        }
    }
    cout << m;
}


#include <iostream>

using namespace std;

int main()
{
    int n = 0, m = 0, min = 100, max = 0, a = 0, b = 0, i = 0;
    cin >> n;
    while (cin >> m)
    {
        i++;
        if (m > max)
        {
            max = m;
            a = i;
        }
        if (m < min)
        {
            min = m;
            b = i;
        }
    }
    i = a - 1;
    if (m != min)
    {
        i += n - b;
    }
    if (a > b)
    {
        i -= 2;
        if (n == 2)
        {
            i++;
        }
    }
    cout << i;
}


include <iostream>

using namespace std;

int main()
{
    int n = 0, m = 0, min = 100, max = 0, a = 0, b = 0, i = 0;
    cin >> n;
    while (cin >> m)
    {
        i++;
        if (m > max)
        {
            max = m;
            a = i;
        }
        if (m < min)
        {
            min = m;
            b = i;
        }
    }
    m = a - 1;
    if (m != min)
    {
        n - b;
    }
    if (a > b)
    {
        m -= 2;
        if (n == 2)
        {
            m++;
        }
    }
    cout << m;
}


#include <iostream>

using namespace std;

int main()
{
    int n = 0, m = 0, min = 100, max = 0, a = 0, b = 0, i = 0;
    cin >> n;
    while (cin >> m)
    {
        i++;
        if (m > max)
        {
            max = m;
            a = i;
        }
        if (m < min)
        {
            min = m;
            b = i;
        }
    }
    m = a - 1;
    if (m != min)
    {
        m += n - b;
    }
    if (a > b)
    {
        m -= 2;
        if (n == 2)
        {
            m++;
        }
    }
    cout << m;
}


#include <iostream>

using namespace std;

int main()
{
    int n = 0, m = 0, min = 100, max = 0, a = 0, b = 0, i = 0;
    cin >> n;
    while (cin >> m)
    {
        i++;
        if (m > max)
        {
            max = m;
            a = i;
        }
        if (m < min)
        {
            min = m;
            b = i;
        }
    }
    m = a - 1 + n - b;
    if (a > b)
    {
        m -= 2;
    }
    cout << m;
}


#include <iostream>

using namespace std;

int main()
{
    int n = 0, m = 0, min = 100, max = 0, a = 0, b = 0, i = 0;
    cin >> n;
    while (cin >> m)
    {
        i++;
        if (m > max)
        {
            max = m;
            a = i;
        }
        if (m <= min)
        {
            min = m;
            b = i;
        }
    }
    i = a - 1 + n - b;
    if (a > b)
    {
        i--;
    }
    cout << i;
}


#include <iostream>

using namespace std;

int main()
{
    int n = 0, m = 0, min = 100, max = 0, a = 0, b = 0, i = 0;
    cin >> n;
    while (cin >> m)
    {
        i++;
        if (m > max)
        {
            max = m;
            a = i;
        }
        if (m < min)
        {
            min = m;
            b = i;
        }
    }
    m = a - 1;
    if (m != min)
    {
        n - b;
    }
    if (a > b)
    {
        m -= 2;
        if (n == 2)
        {
            m++;
        }
    }
    cout << m;
}


// Codeforces1.cpp : Defines the entry point for the console application.
//

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

using namespace std;

void main()
{
	int n=0;
	cin>>n;
	if (n==1)
	{
		cout<<0;
		return;
	}
	vector <int> k(n,0);
	for (int i=0;i<n;++i)
		cin>>k[i];
	int min=k[0];
	int max=k[0];
	int minpos=0;
	int maxpos=0;
	for (int i=0;i<k.size();++i)
	{
		if (min>=k[i])
		{
			min=k[i];
			minpos=i;
		}
		if (max<k[i])
		{
			max=k[i];
			maxpos=i;
		}
	}
	int res=maxpos+k.size()-minpos-1;
	if (maxpos>=minpos)
		res-=1;
	cout<<res;
}


// Codeforces1.cpp : Defines the entry point for the console application.
//

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

using namespace std;

int main()
{
	int n;
	cin>>n;
	vector <int> k;
	int temp=0;
	while(cin>>temp)
		k.push_back(temp);
	int min=k[0];
	int max=k[0];
	int minpos=0;
	int maxpos=0;
	for (int i=0;i<k.size();++i)
	{
		if (min>=k[i])
		{
			min=k[i];
			minpos=i;
		}
		if (max<=k[i])
		{
			max=k[i];
			maxpos=i;
		}
	}
	int res=maxpos+k.size()-minpos-1;
	if (maxpos>=minpos)
		res-=1;
	cout<<res;
	return res;
}


// Codeforces1.cpp : Defines the entry point for the console application.
//

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

using namespace std;

void main()
{
	int n=0;
	cin>>n;
	vector <int> k(n,0);
	for (int i=0;i<n;++i)
		cin>>k[i];
	int min=k[0];
	int max=k[0];
	int minpos=0;
	int maxpos=0;
	for (int i=0;i<k.size();++i)
	{
		if (min>=k[i])
		{
			min=k[i];
			minpos=i;
		}
		if (max<=k[i])
		{
			max=k[i];
			maxpos=i;
		}
	}
	int res=maxpos+k.size()-minpos-1;
	if (maxpos>=minpos)
		res-=1;
	cout<<res;
}


// Codeforces1.cpp : Defines the entry point for the console application.
//

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

using namespace std;

int main()
{
	int n;
	cin>>n;
	vector <int> k(n,0);
	for (int i=0;i<n;++i)
		cin>>k[i];
	int min=k[0];
	int max=k[0];
	int minpos=0;
	int maxpos=0;
	for (int i=0;i<k.size();++i)
	{
		if (min>=k[i])
		{
			min=k[i];
			minpos=i;
		}
		if (max<=k[i])
		{
			max=k[i];
			maxpos=i;
		}
	}
	int res=maxpos+k.size()-minpos-1;
	if (maxpos>=minpos)
		res-=1;
	cout<<res;
	return res;
}


// Codeforces1.cpp : Defines the entry point for the console application.
//

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

using namespace std;

void main()
{
	int n=0;
	cin>>n;
	if (n==1)
	{
		cout<<0;
		return;
	}
	vector <int> k(n,0);
	for (int i=0;i<n;++i)
		cin>>k[i];
	int min=k[0];
	int max=k[0];
	int minpos=0;
	int maxpos=0;
	for (int i=0;i<k.size();++i)
	{
		if (min>=k[i])
		{
			min=k[i];
			minpos=i;
		}
		if (max<=k[i])
		{
			max=k[i];
			maxpos=i;
		}
	}
	int res=maxpos+k.size()-minpos-1;
	if (maxpos>=minpos)
		res-=1;
	cout<<res;
}


// Codeforces1.cpp : Defines the entry point for the console application.
//

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

using namespace std;

int main()
{
	int n;
	cin>>n;
	vector <int> k(n,0);
	int temp=0;
	for (int i=0;i<n;++i)
		cin>>k[i];
	int min=k[0];
	int max=k[0];
	int minpos=0;
	int maxpos=0;
	for (int i=0;i<k.size();++i)
	{
		if (min>=k[i])
		{
			min=k[i];
			minpos=i;
		}
		if (max<=k[i])
		{
			max=k[i];
			maxpos=i;
		}
	}
	int res=maxpos+k.size()-minpos-1;
	if (maxpos>=minpos)
		res-=1;
	cout<<res;
	return res;
}


n=int(input())
a=input().split()
mylist=[]
for i in a:
    mylist.append(int(i))
    maximum=max(mylist)
    minimum=min(mylist)
    m=mylist.index(maximum)
    g=mylist.index(minimum)
    if m==mylist[0]:
        difference=0
    else:
        difference=m-1

    if g==mylist[-1]:
        sum=0
    else:
        sum=g-(m-1)
print(abs(sum-difference))


n=int(input())
a=input().split()
mylist=[]
for i in a:
    mylist.append(int(i))
    maximum=max(mylist)
    minimum=min(mylist)
    m=mylist.index(maximum)
    g=mylist.index(minimum)
    f=len(mylist)
if f<=2:
    print(1)
else:
    if m==mylist[0]:
        difference=0
    else:
        difference=m-1

    if g==mylist[-1]:
        sum=0
    else:
        sum=g-(m-1)
    print(abs(sum-difference))


n = int(input())
a = input().split()
mylist = []
for i in a:
    mylist.append(int(i))
maximum = max(mylist)
minimum = min(mylist)
m = mylist.index(maximum)
g = mylist.index(minimum)
f = len(mylist)

if m==0 and g==n-1:
    print(0)
elif f <= 2:
    print(1)
else:
    if m == mylist[0]:
        difference = 0
    else:
        difference = m - 1

    if g == mylist[-1]:
        sum = 0
    else:
        sum = g - (m - 1)
    print(abs(sum - difference))


n = int(input())
a = input().split()
mylist = []
for i in a:
    mylist.append(int(i))
maximum = max(mylist)
minimum = min(mylist)
m = mylist.index(maximum)
g = mylist.index(minimum)
f = len(mylist)
if m==0:
    print(0)
elif f <= 2:
    print(1)
else:
    if m == mylist[0]:
        difference = 0
    else:
        difference = m - 1

    if g == mylist[-1]:
        sum = 0
    else:
        sum = g - (m - 1)
    print(abs(sum - difference))


n = int(input())
a = input().split()
mylist = []
for i in a:
    mylist.append(int(i))

maximum = max(mylist)
minimum = min(mylist)
maxIndex = mylist.index(maximum)
mylist.reverse()
minIndex = mylist.index(minimum)

if len(mylist) - minIndex > maxIndex:
    print(maxIndex + minIndex)
else:
    print(maxIndex + minIndex-1)


n=int(input())
max=0
min=100
s = list(map(int, input().split()))
for i in range(len(s)):
    if s[i]>max:
        max=s[i]
        maxl=i
    if s[i]<min:
        min=s[i]
        minl=i
if maxl>minl:
    if n==2:
        print('1')
    else:
        print(maxl+len(s)-minl-3)
else:
    print(maxl+len(s)-minl-1)


n=int(input())
max=0
min=100
s = list(map(int, input().split()))
for i in range(len(s)):
    if s[i]>max:
        max=s[i]
        maxl=i
    if s[i]<=min:
        min=s[i]
        minl=i
if maxl>minl:
    if n==2:
        print('1')
    else:
        print(maxl+len(s)-minl-3)
else:
    print(maxl+len(s)-minl-1)


n=int(input())
max=0
min=100
s = list(map(int, input().split()))
for i in range(len(s)):
    if s[i]>max:
        max=s[i]
        maxl=i
    if s[i]<=min:
        min=s[i]
        minl=i
if maxl>minl:
    if n==2:
        print('1')
    else:
        print(maxl+len(s)-minl-2)
else:
    print(maxl+len(s)-minl-1)


n=int(input())
max=0
min=100
s = list(map(int, input().split()))
for i in range(len(s)):
    if s[i]>max:
        max=s[i]
        maxl=i
    if s[i]<min:
        min=s[i]
        minl=i
if maxl>minl:
    print(maxl+len(s)-minl-3)
else:
    print(maxl+len(s)-minl-1)


n=int(input())
max=0
min=100
s = list(map(int, input().split()))
for i in range(len(s)):
    if s[i]>max:
        max=s[i]
        maxl=i
    if s[i]<min:
        min=s[i]
        minl=i
if maxl>minl:
    print(maxl+len(s)-minl-2)
else:
    print(maxl+len(s)-minl-1)


n=int(input())
max=0
min=100
s = list(map(int, input().split()))
for i in range(len(s)):
    if s[i]>max:
        max=i
    if s[i]<min:
        min=i
if max>min:
    print(max+len(s)-min-3)
else:
    print(max+len(s)-min-2)


n=input()
stroy=list(map(int, input().split()))
indexlong=stroy.index(max(stroy))
indexshor=(stroy[::-1]).index(min(stroy))
if indexlong+indexshor>=len(stroy): #or indexlong==indexshor>len(stroy)==len(stroy)//2:
    time=indexlong+indexshor-1
else:
    time=indexlong+indexshor
print(time)


n=input()
stroy=list(map(int, input().split()))
indexlong=stroy.index(max(stroy))
indexshor=(stroy[::-1]).index(min(stroy))
if indexlong>=indexshor:
    time=indexlong+indexshor-1
else:
    time=indexlong+indexshor
print(time)

print(indexlong,indexshor)


n=input()
stroy=list(map(int, input().split()))
indexlong=stroy.index(max(stroy))
indexshor=(stroy[::-1]).index(min(stroy))
if indexlong>indexshor or len(stroy)==2:
    time=indexlong+indexshor-1
else:
    time=indexlong+indexshor
print(time)


n=input()
stroy=list(map(int, input().split()))
indexlong=stroy.index(max(stroy))
indexshor=(stroy[::-1]).index(min(stroy))
if indexlong+indexshor>len(stroy) or len(stroy)==2:
    time=indexlong+indexshor-1
else:
    time=indexlong+indexshor
print(time)


#include<bits/stdc++.h>
#define X first
#define Y second
#define pb emplace_back
#define int long long
#define ALL(x) x.begin(),x.end()
#define mm(x,n) memset(x,n,sizeof(x))
#define rep0(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,a,b) for(int i=a;i<=b;i++)
#define IOS cin.tie(0); ios::sync_with_stdio(0);
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;

main(){
	int n,x,y; cin >> n >> x >> y;
	string s; cin >> s;
	int cnt0 = 0,ans = 0,group = 0;
	rep0(i,1,n)
		if(s[i] == '1' && s[i-1] == '0') group++;
	if(s[n - 1] == '0') group++;
	//cout << group << endl;
	if(group == n){
		cout << 0;
		return false;
	}
	int ans = (group - 1)*min(x,y) + y;
	cout << ans ;
}


#include <stdio.h>
char a[300005];
int main()
{
    long n, x, y;
    scanf("%ld %ld %ld", &n, &x, &y);
    long i;
    long cnt = 0;
    getchar();
    gets(a);
    a[n] = '1';
    for (i = 0; i < n;i++){
        if(a[i]=='0'&&a[i+1]!='0'){
            cnt++;
        }
    }
    // printf("%ld\n", cnt);
    long long ans = 0;
    if(cnt==0){
        printf("0\n");
        return 0;
    }
    if (x < y)
    {
        ans = (cnt - 1) * x + y;
    }
    else
    {
        ans = cnt * y;
    }
    printf("%lld\n", ans);
    return 0;
}


#include <stdio.h>
char a[300005];
int main()
{
    long n, x, y;
    scanf("%ld %ld %ld", &n, &x, &y);
    long long i;
    long long cnt = 0;
    scanf("%s", a);
    a[n] = '1';
    for (i = 0; i < n;i++){
        if(a[i]=='0'&&a[i+1]!='0'){
            cnt++;
        }
    }
    // printf("%ld\n", cnt);
    long long ans = 0;
    if(cnt==0){
        printf("0\n");
        return 0;
    }
    if (x < y)
    {
        ans = (cnt - 1) * x + y;
    }
    else
    {
        ans = cnt * y;
    }
    printf("%lld\n", ans);
    return 0;
}


#include<bits/stdc++.h>
#define N 300005
using namespace std;
char s[N];
int main()
{
    int n,x,y;
    scanf("%d%d%d",&n,&x,&y);
    scanf("%s",s);
    int p=0;
    for(int i=0;i<n;i++)
        if(s[i]=='0')p++;
    if(p==0)
    {
        puts("0");
        return 0;
    }
    long long ans=0;
    if(x>=y)
    {
        for(int i=1;i<n;i++)
            if(s[i]=='1'&&s[i-1]=='0')ans+=y;
        if(s[n-1]=='0')ans+=y;
        printf("%lld\n",ans);
    }else
    {
        if(s[0]=='0')p=1;else p=0;
        for(int i=1;i<n;i++)
            if(s[i]=='0')
            {
                p++;
                if(p>1&&s[i-1]=='1')ans+=x;
            }
        ans+=y;
        printf("%lld\n",ans);
    }
    return 0;
}


#include <stdio.h>
char a[300005];
int main()
{
    long n, x, y;
    scanf("%ld %ld %ld", &n, &x, &y);
    long i;
    long cnt = 0;
    getchar();
    gets(a);
    a[n] = '1';
    for (i = 0; i < n;i++){
        if(a[i]=='0'&&a[i+1]!='0'){
            cnt++;
        }
    }
    // printf("%ld\n", cnt);
    long long ans = 0;
    if(cnt==0){
        printf("0\n");
        return 0;
    }
    if (x <= y)
    {
        ans = (cnt - 1) * x + y;
    }
    else
    {
        ans = cnt * y;
    }
    printf("%lld\n", ans);
    return 0;
}


#include <stdio.h>
char a[300005];
int main()
{
    long n, x, y;
    scanf("%ld %ld %ld", &n, &x, &y);
    long i;
    long cnt = 0;
    scanf("%s", a);
    a[n] = '1';
    for (i = 0; i < n;i++){
        if(a[i]=='0'&&a[i+1]!='0'){
            cnt++;
        }
    }
    // printf("%ld\n", cnt);
    long long ans = 0;
    if(cnt==0){
        printf("0\n");
        return 0;
    }
    if (x < y)
    {
        ans = (cnt - 1) * x + y;
    }
    else
    {
        ans = cnt * y;
    }
    printf("%lld\n", ans);
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int x,y,n;
    cin>>n>>x>>y;
    char io[666666];
    cin>>(io+1);
    int conv=0;
    long long ans=8e18;
    for(int i=0;i<n;i++)
    {
        if(io[i]=='0' && io[i-1]=='1')conv++;
    }
    if(conv==0)
        ans=0;
    for(int i=0;i<conv;i++)
    {
        ans=min(ans,x*(long long)(i)+y*(long long)(conv-i));
    }
    cout<<ans;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int x,y,n;
    cin>>n>>x>>y;
    char io[666666];
    cin>>(io+1);
    int conv=0;
    long long ans=0;
    for(int i=1;i<=n;i++)
    {
        if(io[i]=='0' && io[i-1]!='0')conv++;
    }
    if(conv==0)
        ans=0;
    for(int i=0;i<conv;i++)
    {
        ans=min(ans,x*(long long)(i)+y*(long long)(conv-i));
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,y;
    cin>>n>>x>>y;
    string st;
    cin>>st;
    int n=st.length();
    vector<bool> arr;
    for(int i=0;i<n-1;i++)
    {
        while(i<n-1 && st[i]==st[i+1])
            i++;
        if(st[i]=='0')
            arr.push_back(false);
        else
            arr.push_back(true);
    }
    if(st[n-1]!=st[n-2])
    {
        if(st[n-1]=='1')
            arr.push_back(true);
        else
            arr.push_back(false);
    }
    if(x>y)
    {
        int res=0;
        for(int i=0;i<arr.size();i++)
            if(arr[i]==false)res++;
        cout<<res*y<<endl;
        exit(0);
    }
    int res=0,ones=0;
    for(int i=0;i<arr.size();i++)
    {
        if(arr[i]==true)
            res+=(i-ones);
    }
    cout<<res*x+y<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long n;
    long long int x,y;
    cin>>n>>x>>y;
    string st;
    cin>>st;
    //int n=st.length();
    vector<bool> arr;
    for(int i=0;i<n-1;i++)
    {
        while(i<n-1 && st[i]==st[i+1])
            i++;
        if(st[i]=='0')
            arr.push_back(false);
        else
            arr.push_back(true);
    }
    if(st[n-1]!=st[n-2])
    {
        if(st[n-1]=='1')
            arr.push_back(true);
        else
            arr.push_back(false);
    }
    if(x>y)
    {
        int res=0;
        for(int i=0;i<arr.size();i++)
            if(arr[i]==false)res++;
        cout<<res*y<<endl;
        exit(0);
    }
    int res=0,ones=0;
    for(int i=0;i<arr.size();i++)
    {
        if(arr[i]==true)
            res+=(i-ones);
    }
    if(find(arr.begin(),arr.end(),false)==arr.end())
        y=0;
    cout<<res*x+y<<endl;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int x,y,n;
    cin>>n>>x>>y;
    char io[666666];
    cin>>(io+1);
    int conv=0;
    long long ans=0;
    for(int i=0;i<n;i++)
    {
        if(io[i]=='0' && io[i-1]!='0')conv++;
    }
    if(conv==0)
        ans=0;
    for(int i=0;i<conv;i++)
    {
        ans=min(ans,x*(long long)(i)+y*(long long)(conv-i));
    }
    cout<<ans;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int x,y,n;
    cin>>n>>x>>y;
    char io[666666];
    cin>>(io+1);
    int conv=0;
    long long ans=8e18;
    for(int i=1;i<=n;i++)
    {
        if(io[i]=='0' && io[i-1]!='0')conv++;
    }
    if(conv==0)
        ans=0;
    for(int i=0;i<conv;i++)
    {
        ans=min(ans,x*(long long)(i)+y*(long long)(conv-i));
    }
    cout<<ans;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int x,y,n;
    cin>>n>>x>>y;
    char io[666666];
    cin>>(io+1);
    int conv=0;
    long long ans=0;
    for(int i=0;i<n;i++)
    {
        if(io[i]=='0' && io[i-1]=='1')conv++;
    }
    if(conv==0)
        ans=0;
    for(int i=0;i<conv;i++)
    {
        ans=min(ans,x*(long long)(i)+y*(long long)(conv-i));
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,y;
    cin>>n>>x>>y;
    string st;
    cin>>st;
    //int n=st.length();
    vector<bool> arr;
    for(int i=0;i<n-1;i++)
    {
        while(i<n-1 && st[i]==st[i+1])
            i++;
        if(st[i]=='0')
            arr.push_back(false);
        else
            arr.push_back(true);
    }
    if(st[n-1]!=st[n-2])
    {
        if(st[n-1]=='1')
            arr.push_back(true);
        else
            arr.push_back(false);
    }
    if(x>y)
    {
        int res=0;
        for(int i=0;i<arr.size();i++)
            if(arr[i]==false)res++;
        cout<<res*y<<endl;
        exit(0);
    }
    int res=0,ones=0;
    for(int i=0;i<arr.size();i++)
    {
        if(arr[i]==true)
            res+=(i-ones);
    }
    if(find(arr.begin(),arr.end(),false)==arr.end())
        y=0;
    cout<<res*x+y<<endl;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int x,y,n;
    cin>>n>>x>>y;
    string io;
    cin>>(io+1);
    int conv=0;
    long long ans=0;
    for(int i=0;i<n;i++)
    {
        if(io[i]=='0' && io[i-1]=='1')conv++;
    }
    if(conv==0)
        ans=0;
    for(int i=0;i<conv;i++)
    {
        ans=min(ans,x*(long long)(i)+y*(long long)(conv-i));
    }
    cout<<ans;
}


#include <bits/stdc++.h>

using namespace std;

#define fast_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define int long long
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define MOD 1000000007

const int dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};

signed main()
{
    fast_IO;
    // freopen("input.txt", "rt", stdin);
    // freopen("output.txt", "wt", stdout);
    int test = 1;
    // cin >> test;
    while(test--)
    {
        int n, x, y;
        cin >> n >> x >> y;
        string s;
        cin >> s;
        vector<char> vec;
        vec.pb(s[0]);
        for(int i = 0; i < s.length() - 1; i++)
            if(s[i + 1] != s[i])
                vec.pb(s[i + 1]);
        int reverse_and_invert = x + y;
        int invert = y;
        int zer = 0;
        for(auto xx: vec)
            if(xx == '0')
                zer++;
        int ans = (zer / 2) * min(reverse_and_invert, 2 * invert);
        ans += (zer % 2) * invert;
        cout << ans << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define fast_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define int long long
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define MOD 1000000007

const int dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};

signed main()
{
    fast_IO;
    // freopen("input.txt", "rt", stdin);
    // freopen("output.txt", "wt", stdout);
    int test = 1;
    // cin >> test;
    while(test--)
    {
        int n, x, y;
        cin >> n >> x >> y;
        string s;
        cin >> s;
        vector<char> vec;
        vec.pb(s[0]);
        for(int i = 0; i < s.length() - 1; i++)
            if(s[i + 1] != s[i])
                vec.pb(s[i + 1]);
        int reverse_and_invert = x + y;
        int invert = y;
        int zer = 0;
        for(auto xx: vec)
            if(xx == '0')
                zer++;
        int ans = (zer / 2);
        ans *= min(reverse_and_invert, 2 * invert);
        ans += (zer % 2) * invert;

        int ans3 = y + (vec.size() - zer) * x;

        int ans2 = 0;
        if(vec[0] == vec[vec.size() - 1] and vec[0] == '0')
            vec[0] = 1, ans2 = x, zer--;
        ans2 += ((int)(zer / 2)) * min(reverse_and_invert, 2 * invert);
        ans2 += (zer % 2) * invert;

        cout << min({ans, ans2, ans3}) << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define fast_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define int long long
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define MOD 1000000007

const int dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};

signed main()
{
    fast_IO;
    // freopen("input.txt", "rt", stdin);
    // freopen("output.txt", "wt", stdout);
    int test = 1;
    // cin >> test;
    while(test--)
    {
        int n, x, y;
        cin >> n >> x >> y;
        string s;
        cin >> s;
        vector<char> vec;
        vec.pb(s[0]);
        for(int i = 0; i < s.length() - 1; i++)
            if(s[i + 1] != s[i])
                vec.pb(s[i + 1]);
        int reverse_and_invert = x + y;
        int invert = y;
        int zer = 0;
        for(auto xx: vec)
            if(xx == '0')
                zer++;
        int ans = (zer / 2);
        ans *= min(reverse_and_invert, 2 * invert);
        ans += (zer % 2) * invert;
        cout << ans << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define fast_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define int long long
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define MOD 1000000007

const int dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};

signed main()
{
    fast_IO;
    // freopen("input.txt", "rt", stdin);
    // freopen("output.txt", "wt", stdout);
    int test = 1;
    // cin >> test;
    while(test--)
    {
        int n, x, y;
        cin >> n >> x >> y;
        string s;
        cin >> s;
        vector<char> vec;
        vec.pb(s[0]);
        for(int i = 0; i < s.length() - 1; i++)
            if(s[i + 1] != s[i])
                vec.pb(s[i + 1]);
        int reverse_and_invert = x + y;
        int invert = y;
        int zer = 0;
        for(auto xx: vec)
            if(xx == '0')
                zer++;
        int ans = min(zer * y, max(0LL, ((zer - 1) * x) + y));
        // int ans = (zer / 2);
        // ans *= min(reverse_and_invert, 2 * invert);
        // ans += (zer % 2) * invert;

        // int ans3 = y + (vec.size() - zer) * x;

        // // int ans2 = 0;
        // // if(vec[0] == vec[vec.size() - 1] and vec[0] == '0')
        // //     vec[0] = 1, ans2 = x, zer--;
        // // ans2 += ((int)(zer / 2)) * min(reverse_and_invert, 2 * invert);
        // // ans2 += (zer % 2) * invert;

        cout << max(0LL, ans) << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define fast_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define int long long
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define MOD 1000000007

const int dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};

signed main()
{
    fast_IO;
    // freopen("input.txt", "rt", stdin);
    // freopen("output.txt", "wt", stdout);
    int test = 1;
    // cin >> test;
    while(test--)
    {
        int n, x, y;
        cin >> n >> x >> y;
        string s;
        cin >> s;
        vector<char> vec;
        vec.pb(s[0]);
        for(int i = 0; i < s.length() - 1; i++)
            if(s[i + 1] != s[i])
                vec.pb(s[i + 1]);
        int reverse_and_invert = x + y;
        int invert = y;
        int zer = 0;
        for(auto xx: vec)
            if(xx == '0')
                zer++;
        int ans = (zer / 2);
        ans *= min(reverse_and_invert, 2 * invert);
        ans += (zer % 2) * invert;

        int ans3 = y + (vec.size() - zer) * x;

        // int ans2 = 0;
        // if(vec[0] == vec[vec.size() - 1] and vec[0] == '0')
        //     vec[0] = 1, ans2 = x, zer--;
        // ans2 += ((int)(zer / 2)) * min(reverse_and_invert, 2 * invert);
        // ans2 += (zer % 2) * invert;

        cout << min({ans, ans3}) << endl;
    }
    return 0;
}


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

int main()
{
    string s;
    unsigned long long int x,y,n,i,c;
    cin>>n>>x>>y;
    cin>>s;
    c=0;
    bool f=0;
    for(i=0;i<s.length();i++)
    {
        if(s[i]=='0' && f==0)
        {
            c++;
            f=1;
        }

        else if(s[i]=='1' && f==1)
        {
            f=0;
        }

    }

    unsigned long long int cost;
    if(c == 0)
    {
        cout<<"0";
    }
    else
    {
    cost = min((c*y),((c-1)*x+y));
    printf("%lld",cost);
    }

}


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

int main()
{
    string s;
    unsigned long long int x,y,n,i,c;
    cin>>n>>x>>y;
    cin>>s;
    c=0;
    bool f=0;
    for(i=0;i<s.length();i++)
    {
        if(s[i]=='0' && f==0)
        {
            c++;
            f=1;
        }

        else if(s[i]=='1' && f==1)
        {
            f=0;
        }

    }

    unsigned long long int cost;
    if(c == 0)
    {
        cout<<"0";
    }
    else
    {
    cost = min((c*y),((c-1)*x+y));
    printf("%ld",cost);
    }

}


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

int main()
{
  int64_t n,x,y,g=0;
  string s;
  cin>>n>>x>>y;
  cin>>s;
  int p=1;
  for(char c:s) {
    if(c=='0'){ if(p==1)g++;p=0;}
    else p=1;
  }

  if(g==0){cout<<0;}
  else {cout<<y+(g-1)*min(x,y);}
  return 0;
}


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

int main()
{
    string s;
    long int x,y,n,i,c;
    cin>>n>>x>>y;
    cin>>s;
    c=0;
    bool f=0;
    for(i=0;i<s.length();i++)
    {
        if(s[i]=='0' && f==0)
        {
            c++;
            f=1;
        }

        else if(s[i]=='1' && f==1)
        {
            f=0;
        }

    }

    long int cost;
    if(c == 0)
    {
        cout<<"0";
    }
    else
    {
    cost = min((c*y),((c-1)*x+y));
    printf("%ld",cost);
    }

}


 #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define war(i,s,n) for(long long i=s;i<n;i++)
#define pb push_back
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define fr first
#define sc second
#define ot(x) cout<<x<<"\n";
#define mod 1000000007
#define vctr2d vector<vector<long long>>
#define vctr vector<long long>
#define pll pair<long long,long long>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mod2  998244353
#define arrin(a,n) for(int i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(int i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl;exit(0);
#define init(a,n,x) for(int i = 0;i < n ; i++ ){a[i]=x;}
#define itr iterator
#define l_max 10000000000000000
#define tra(it,m) for(it=m.begin();it!=m.end();++it)
ll sigma(ll n)
{
 return (n*(n+1)/2);
}
ll MOD(ll x){if(x>=0)return x; return (-x);}
bool great(ll a,ll b){return a>b;}
bool p_sm(pll a,pll b){if(a.fr==b.fr){return(a.sc<b.sc);}return (a.fr<b.fr);}
ll max3(ll a,ll b,ll c){return (max(a,max(b,c)));}
ll max4(ll a,ll b,ll c,ll d){return (max(max(a,b),max(c,d)));}
ll min3(ll a,ll b,ll c){return (min(a,min(b,c)));}
ll min4(ll a,ll b,ll c,ll d){return (min(min(a,b),min(c,d)));}
/*********************************/////////////////////////////////////////*************
vctr factors(ll x)
{
 vctr v;
   for(int i=1;i*i<=x;i++)
   {
     if(x%i==0)
     {
       v.pb(i);
       if(i!=x/i)
       {v.pb(x/i);}
     }
   }
   return v;
}
ll min_prime[1000006];
bool ispr[1000006];
void strt()
{
 init(min_prime,1000005,-1);
 init(ispr,1000005,true);
 for(ll i=2;i*i<=1000005;i++)
 {
   if(!ispr[i]){continue;}
   for(ll j=i*i;j<=1000005;j+=i)
   {
     if(min_prime[j]==-1)
     min_prime[j]=i;
     ispr[j]=false;
   }
 }
 war(i,2,1000006)
 {
   if(ispr[i])
   {
     min_prime[i]=i;
   }
 }
}
map<ll,ll> prime_fact(ll x)
{
   map<ll,ll> mp;
     while(x!=1)
     {
       mp[min_prime[x]]++;
       x/=min_prime[x];
     }
     return mp;
}
ll power(ll a,ll b,ll m)
{
   ll ans=1;
   while(b>0)
   {
       if(b%2)
       {
           ans=(ans*a)%m;
       }
       a=(a*a)%m;
       b=b/2;
   }
   return ans;
}
vector<int> prefix_function(string s)
{
 int n = (int)s.length();vector<int> pi(n);
 for (int i = 1; i < n; i++) {
     int j = pi[i-1];
     while (j > 0 && s[i] != s[j])
           j = pi[j-1];
     if (s[i] == s[j])
       j++;
     pi[i] = j;        }
     return pi;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
      speed;
      ll n,x,y;
      cin>>n>>x>>y;
      string s;
      cin>>s;
      ll zero=0;
      war(i,0,n-1)
      {
        if(s[i]=='0'&&s[i+1]=='1')
        {zero++;}
      }
      if(s[n-1]=='0')
      zero++;
      ll ans=0;
      war(i,1,zero+1)
      {
        ans=max((i*y+(zero-i)*x),ans);
      }
      cout<<ans<<endl;
}


 #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define war(i,s,n) for(long long i=s;i<n;i++)
#define pb push_back
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define fr first
#define sc second
#define ot(x) cout<<x<<"\n";
#define mod 1000000007
#define vctr2d vector<vector<long long>>
#define vctr vector<long long>
#define pll pair<long long,long long>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mod2  998244353
#define arrin(a,n) for(int i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(int i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl;exit(0);
#define init(a,n,x) for(int i = 0;i < n ; i++ ){a[i]=x;}
#define itr iterator
#define l_max 10000000000000000
#define tra(it,m) for(it=m.begin();it!=m.end();++it)
ll sigma(ll n)
{
 return (n*(n+1)/2);
}
ll MOD(ll x){if(x>=0)return x; return (-x);}
bool great(ll a,ll b){return a>b;}
bool p_sm(pll a,pll b){if(a.fr==b.fr){return(a.sc<b.sc);}return (a.fr<b.fr);}
ll max3(ll a,ll b,ll c){return (max(a,max(b,c)));}
ll max4(ll a,ll b,ll c,ll d){return (max(max(a,b),max(c,d)));}
ll min3(ll a,ll b,ll c){return (min(a,min(b,c)));}
ll min4(ll a,ll b,ll c,ll d){return (min(min(a,b),min(c,d)));}
/*********************************/////////////////////////////////////////*************
vctr factors(ll x)
{
 vctr v;
   for(int i=1;i*i<=x;i++)
   {
     if(x%i==0)
     {
       v.pb(i);
       if(i!=x/i)
       {v.pb(x/i);}
     }
   }
   return v;
}
ll min_prime[1000006];
bool ispr[1000006];
void strt()
{
 init(min_prime,1000005,-1);
 init(ispr,1000005,true);
 for(ll i=2;i*i<=1000005;i++)
 {
   if(!ispr[i]){continue;}
   for(ll j=i*i;j<=1000005;j+=i)
   {
     if(min_prime[j]==-1)
     min_prime[j]=i;
     ispr[j]=false;
   }
 }
 war(i,2,1000006)
 {
   if(ispr[i])
   {
     min_prime[i]=i;
   }
 }
}
map<ll,ll> prime_fact(ll x)
{
   map<ll,ll> mp;
     while(x!=1)
     {
       mp[min_prime[x]]++;
       x/=min_prime[x];
     }
     return mp;
}
ll power(ll a,ll b,ll m)
{
   ll ans=1;
   while(b>0)
   {
       if(b%2)
       {
           ans=(ans*a)%m;
       }
       a=(a*a)%m;
       b=b/2;
   }
   return ans;
}
vector<int> prefix_function(string s)
{
 int n = (int)s.length();vector<int> pi(n);
 for (int i = 1; i < n; i++) {
     int j = pi[i-1];
     while (j > 0 && s[i] != s[j])
           j = pi[j-1];
     if (s[i] == s[j])
       j++;
     pi[i] = j;        }
     return pi;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
      speed;
      ll n,x,y;
      cin>>n>>x>>y;
      string s;
      cin>>s;
      ll zero=0;
      war(i,0,n-1)
      {
        if(s[i]=='0'&&s[i+1]=='1')
        {zero++;}
      }
      if(s[n-1]=='0')
      zero++;
      if(!zero)
      {ex(0);}
      cout<<(zero-1)*min(x,y)+y<<endl;

}


 #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define war(i,s,n) for(long long i=s;i<n;i++)
#define pb push_back
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define fr first
#define sc second
#define ot(x) cout<<x<<"\n";
#define mod 1000000007
#define vctr2d vector<vector<long long>>
#define vctr vector<long long>
#define pll pair<long long,long long>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mod2  998244353
#define arrin(a,n) for(int i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(int i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl;exit(0);
#define init(a,n,x) for(int i = 0;i < n ; i++ ){a[i]=x;}
#define itr iterator
#define l_max 10000000000000000
#define tra(it,m) for(it=m.begin();it!=m.end();++it)
ll sigma(ll n)
{
 return (n*(n+1)/2);
}
ll MOD(ll x){if(x>=0)return x; return (-x);}
bool great(ll a,ll b){return a>b;}
bool p_sm(pll a,pll b){if(a.fr==b.fr){return(a.sc<b.sc);}return (a.fr<b.fr);}
ll max3(ll a,ll b,ll c){return (max(a,max(b,c)));}
ll max4(ll a,ll b,ll c,ll d){return (max(max(a,b),max(c,d)));}
ll min3(ll a,ll b,ll c){return (min(a,min(b,c)));}
ll min4(ll a,ll b,ll c,ll d){return (min(min(a,b),min(c,d)));}
/*********************************/////////////////////////////////////////*************
vctr factors(ll x)
{
 vctr v;
   for(int i=1;i*i<=x;i++)
   {
     if(x%i==0)
     {
       v.pb(i);
       if(i!=x/i)
       {v.pb(x/i);}
     }
   }
   return v;
}
ll min_prime[1000006];
bool ispr[1000006];
void strt()
{
 init(min_prime,1000005,-1);
 init(ispr,1000005,true);
 for(ll i=2;i*i<=1000005;i++)
 {
   if(!ispr[i]){continue;}
   for(ll j=i*i;j<=1000005;j+=i)
   {
     if(min_prime[j]==-1)
     min_prime[j]=i;
     ispr[j]=false;
   }
 }
 war(i,2,1000006)
 {
   if(ispr[i])
   {
     min_prime[i]=i;
   }
 }
}
map<ll,ll> prime_fact(ll x)
{
   map<ll,ll> mp;
     while(x!=1)
     {
       mp[min_prime[x]]++;
       x/=min_prime[x];
     }
     return mp;
}
ll power(ll a,ll b,ll m)
{
   ll ans=1;
   while(b>0)
   {
       if(b%2)
       {
           ans=(ans*a)%m;
       }
       a=(a*a)%m;
       b=b/2;
   }
   return ans;
}
vector<int> prefix_function(string s)
{
 int n = (int)s.length();vector<int> pi(n);
 for (int i = 1; i < n; i++) {
     int j = pi[i-1];
     while (j > 0 && s[i] != s[j])
           j = pi[j-1];
     if (s[i] == s[j])
       j++;
     pi[i] = j;        }
     return pi;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
      speed;
      ll n,x,y;
      cin>>n>>x>>y;
      string s;
      cin>>s;
      ll zero=0;
      war(i,0,n-1)
      {
        if(s[i]=='0'&&s[i+1]=='1')
        {zero++;}
      }
      if(s[n-1]=='0')
      zero++;
      if(!zero)
      {ex(0);}
      ll ans=l_max;
      war(i,1,zero+1)
      {
        ans=min((i*y+(zero-i)*x),ans);
      }
      cout<<ans<<endl;
}


 #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define war(i,s,n) for(long long i=s;i<n;i++)
#define pb push_back
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define fr first
#define sc second
#define ot(x) cout<<x<<"\n";
#define mod 1000000007
#define vctr2d vector<vector<long long>>
#define vctr vector<long long>
#define pll pair<long long,long long>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mod2  998244353
#define arrin(a,n) for(int i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(int i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl;exit(0);
#define init(a,n,x) for(int i = 0;i < n ; i++ ){a[i]=x;}
#define itr iterator
#define l_max 10000000000000000
#define tra(it,m) for(it=m.begin();it!=m.end();++it)
ll sigma(ll n)
{
 return (n*(n+1)/2);
}
ll MOD(ll x){if(x>=0)return x; return (-x);}
bool great(ll a,ll b){return a>b;}
bool p_sm(pll a,pll b){if(a.fr==b.fr){return(a.sc<b.sc);}return (a.fr<b.fr);}
ll max3(ll a,ll b,ll c){return (max(a,max(b,c)));}
ll max4(ll a,ll b,ll c,ll d){return (max(max(a,b),max(c,d)));}
ll min3(ll a,ll b,ll c){return (min(a,min(b,c)));}
ll min4(ll a,ll b,ll c,ll d){return (min(min(a,b),min(c,d)));}
/*********************************/////////////////////////////////////////*************
vctr factors(ll x)
{
 vctr v;
   for(int i=1;i*i<=x;i++)
   {
     if(x%i==0)
     {
       v.pb(i);
       if(i!=x/i)
       {v.pb(x/i);}
     }
   }
   return v;
}
ll min_prime[1000006];
bool ispr[1000006];
void strt()
{
 init(min_prime,1000005,-1);
 init(ispr,1000005,true);
 for(ll i=2;i*i<=1000005;i++)
 {
   if(!ispr[i]){continue;}
   for(ll j=i*i;j<=1000005;j+=i)
   {
     if(min_prime[j]==-1)
     min_prime[j]=i;
     ispr[j]=false;
   }
 }
 war(i,2,1000006)
 {
   if(ispr[i])
   {
     min_prime[i]=i;
   }
 }
}
map<ll,ll> prime_fact(ll x)
{
   map<ll,ll> mp;
     while(x!=1)
     {
       mp[min_prime[x]]++;
       x/=min_prime[x];
     }
     return mp;
}
ll power(ll a,ll b,ll m)
{
   ll ans=1;
   while(b>0)
   {
       if(b%2)
       {
           ans=(ans*a)%m;
       }
       a=(a*a)%m;
       b=b/2;
   }
   return ans;
}
vector<int> prefix_function(string s)
{
 int n = (int)s.length();vector<int> pi(n);
 for (int i = 1; i < n; i++) {
     int j = pi[i-1];
     while (j > 0 && s[i] != s[j])
           j = pi[j-1];
     if (s[i] == s[j])
       j++;
     pi[i] = j;        }
     return pi;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
      speed;
      ll n,x,y;
      cin>>n>>x>>y;
      string s;
      cin>>s;
      ll zero=0;
      war(i,0,n-1)
      {
        if(s[i]=='0'&&s[i+1]=='1')
        {zero++;}
      }
      if(s[n-1]=='0')
      zero++;
      ll ans=l_max;
      war(i,1,zero+1)
      {
        ans=min((i*y+(zero-i)*x),ans);
      }
      cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define pu push
#define bp __builtin_popcount
#define vsz(v) cout<<v.size()<<endl;
#define printv(v) for(ll i=0;i<v.size();i++)cout<<v[i]<<" "; cout<<endl;
#define printa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define printrv(v) for(ll i=v.size()-1;i>=0;i--)cout<<v[i]<<" "; cout<<endl;
#define printvpair(v) for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define vvpll vector<vector<pair<ll,ll>>>
#define qll queue<ll>
#define dqll deque<ll>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define vstr vector<string>
#define setpri(x) cout<<setprecision(x);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define scana(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define inf 1000000000000
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
	while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
	for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
	return ans;
}
ll ncrmod(ll n,ll r,ll mod){
	ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
	return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
	if(n==1 || r==0)return 1;
	ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=(((ans * n )/i)%mod);n--;sum+=ans;sum%=mod;}return sum;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true;
		for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
vll createprime(ll n){
	vector<bool> prime(n+1,true);vll ans;;prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	for(ll i=2;i<=n;i++)if(prime[i])ans.pb(i);
	return ans;
}
vbool createprimebool(ll n){
	vector<bool> prime(n+1,true);prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	return prime;
}
vll factor(ll n){
	vll ans;
	if(n>0)ans.pb(1);if(n==2)ans.pb(2);
	for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
	return ans;
}
ll numoffactor(ll n){ return factor(n).sz;}
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
	if(a.ff != b.ff)return a.ff < b.ff;
	return a.ss > b.ss;
}
void solve(){
	ll i,j,k,n,m,x,y,z,d,l,r;
	ll a,b;
	cin>>n>>a>>b;
	vll v;
	string s;
	cin>>s;
	ll c=1;
	for(i=1;i<n;i++){
	      if(s[i]==s[i-1])c++;
	      else{
	            v.pb(c);
	            c=1;
	      }
	}
	v.pb(c);
	ll an1=0;
	if(v.sz%2==0){
	      an1= (v.sz/2)*b;
	}else if(s[0]=='0'){
	      an1=(v.sz/2 +1)*b;
	}
	ll an2=b;
	ll ans=0;
	for(i=1;i<n;i++){
	      if(s[i]!=s[i-1]){
	            if(s[i]=='1')s[i]='0';
	            else s[i]='1';
	           // reverse(s.begin(),s.begin()+1+i);
	            ans=min(ans+a+b,ans+ 2*b);
	           // cout<<s<<" "<<an2<<endl;
	      }
	}
// 	cout<<an2<<" "<<an1<<endl;
cout<<ans;
// 	cout<<min(an2,an1);

}
int main(){
	FS;
	ll i,j,k,n,m,x,y,z,q;
	q=1;
	// cin>>q;
	while(q--){
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define pu push
#define bp __builtin_popcount
#define vsz(v) cout<<v.size()<<endl;
#define printv(v) for(ll i=0;i<v.size();i++)cout<<v[i]<<" "; cout<<endl;
#define printa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define printrv(v) for(ll i=v.size()-1;i>=0;i--)cout<<v[i]<<" "; cout<<endl;
#define printvpair(v) for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define vvpll vector<vector<pair<ll,ll>>>
#define qll queue<ll>
#define dqll deque<ll>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define vstr vector<string>
#define setpri(x) cout<<setprecision(x);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define scana(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define inf 1000000000000
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
	while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
	for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
	return ans;
}
ll ncrmod(ll n,ll r,ll mod){
	ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
	return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
	if(n==1 || r==0)return 1;
	ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=(((ans * n )/i)%mod);n--;sum+=ans;sum%=mod;}return sum;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true;
		for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
vll createprime(ll n){
	vector<bool> prime(n+1,true);vll ans;;prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	for(ll i=2;i<=n;i++)if(prime[i])ans.pb(i);
	return ans;
}
vbool createprimebool(ll n){
	vector<bool> prime(n+1,true);prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	return prime;
}
vll factor(ll n){
	vll ans;
	if(n>0)ans.pb(1);if(n==2)ans.pb(2);
	for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
	return ans;
}
ll numoffactor(ll n){ return factor(n).sz;}
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
	if(a.ff != b.ff)return a.ff < b.ff;
	return a.ss > b.ss;
}
void solve(){
	ll i,j,k,n,m,x,y,z,d,l,r;
	ll a,b;
	cin>>n>>a>>b;
	vll v;
	string s;
	cin>>s;
	ll c=1;
	for(i=1;i<n;i++){
	      if(s[i]==s[i-1])c++;
	      else{
	            v.pb(c);
	            c=1;
	      }
	}
	v.pb(c);
	ll an1=0;
	if(v.sz%2==0){
	      an1= (v.sz/2)*b;
	}else if(s[0]=='0'){
	      an1=(v.sz/2 +1)*b;
	}
	ll an2=b;
	for(i=1;i<n;i++){
	      if(s[i]!=s[i-1]){
	            reverse(s.begin(),s.begin()+1+i);
	            an2+=a;
	           // cout<<s<<" "<<an2<<endl;
	      }
	}
// 	cout<<an2<<" "<<an1<<endl;
	cout<<min(an2,an1);

}
int main(){
	FS;
	ll i,j,k,n,m,x,y,z,q;
	q=1;
	// cin>>q;
	while(q--){
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define pu push
#define bp __builtin_popcount
#define vsz(v) cout<<v.size()<<endl;
#define printv(v) for(ll i=0;i<v.size();i++)cout<<v[i]<<" "; cout<<endl;
#define printa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define printrv(v) for(ll i=v.size()-1;i>=0;i--)cout<<v[i]<<" "; cout<<endl;
#define printvpair(v) for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define vvpll vector<vector<pair<ll,ll>>>
#define qll queue<ll>
#define dqll deque<ll>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define vstr vector<string>
#define setpri(x) cout<<setprecision(x);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define scana(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define inf 1000000000000
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
	while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
	for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
	return ans;
}
ll ncrmod(ll n,ll r,ll mod){
	ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
	return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
	if(n==1 || r==0)return 1;
	ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=(((ans * n )/i)%mod);n--;sum+=ans;sum%=mod;}return sum;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true;
		for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
vll createprime(ll n){
	vector<bool> prime(n+1,true);vll ans;;prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	for(ll i=2;i<=n;i++)if(prime[i])ans.pb(i);
	return ans;
}
vbool createprimebool(ll n){
	vector<bool> prime(n+1,true);prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	return prime;
}
vll factor(ll n){
	vll ans;
	if(n>0)ans.pb(1);if(n==2)ans.pb(2);
	for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
	return ans;
}
ll numoffactor(ll n){ return factor(n).sz;}
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
	if(a.ff != b.ff)return a.ff < b.ff;
	return a.ss > b.ss;
}
void solve(){
	ll i,j,k,n,m,x,y,z,d,l,r;
	ll a,b;
	cin>>n>>a>>b;
	vll v;
	string s;
	cin>>s;
	ll c=1;
	for(i=1;i<n;i++){
	      if(s[i]==s[i-1])c++;
	      else{
	            v.pb(c);
	            c=1;
	      }
	}
	v.pb(c);
	ll an1=0;
	if(v.sz%2==0){
	      an1= (v.sz/2);
	}else if(s[0]=='0'){
	      an1=(v.sz/2 +1);
	}
	if(an1==0){
	      cout<<0;
	      return;
	}
	ll an2=b;
	an2+= (an1-1)*(min(a,b));
	cout<<an2;

}
int main(){
	FS;
	ll i,j,k,n,m,x,y,z,q;
	q=1;
	// cin>>q;
	while(q--){
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define pu push
#define bp __builtin_popcount
#define vsz(v) cout<<v.size()<<endl;
#define printv(v) for(ll i=0;i<v.size();i++)cout<<v[i]<<" "; cout<<endl;
#define printa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define printrv(v) for(ll i=v.size()-1;i>=0;i--)cout<<v[i]<<" "; cout<<endl;
#define printvpair(v) for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define vvpll vector<vector<pair<ll,ll>>>
#define qll queue<ll>
#define dqll deque<ll>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define vstr vector<string>
#define setpri(x) cout<<setprecision(x);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define scana(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define inf 1000000000000
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
	while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
	for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
	return ans;
}
ll ncrmod(ll n,ll r,ll mod){
	ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
	return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
	if(n==1 || r==0)return 1;
	ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=(((ans * n )/i)%mod);n--;sum+=ans;sum%=mod;}return sum;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true;
		for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
vll createprime(ll n){
	vector<bool> prime(n+1,true);vll ans;;prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	for(ll i=2;i<=n;i++)if(prime[i])ans.pb(i);
	return ans;
}
vbool createprimebool(ll n){
	vector<bool> prime(n+1,true);prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	return prime;
}
vll factor(ll n){
	vll ans;
	if(n>0)ans.pb(1);if(n==2)ans.pb(2);
	for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
	return ans;
}
ll numoffactor(ll n){ return factor(n).sz;}
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
	if(a.ff != b.ff)return a.ff < b.ff;
	return a.ss > b.ss;
}
void solve(){
	ll i,j,k,n,m,x,y,z,d,l,r;
	ll a,b;
	cin>>n>>a>>b;
	vll v;
	string s;
	cin>>s;
	ll c=1;
	for(i=1;i<n;i++){
	      if(s[i]==s[i-1])c++;
	      else{
	            v.pb(c);
	            c=1;
	      }
	}
	v.pb(c);
	ll an1=0;
	if(v.sz%2==0){
	      an1= (v.sz/2)*b;
	}else if(s[0]=='0'){
	      an1=(v.sz/2 +1)*b;
	}
	ll an2=b;
	ll fl=0;
	ll ans=b;
	for(i=1;i<n;i++){
	      if(s[i]!=s[i-1]){
	            if(s[i]=='1')s[i]='0';
	            else s[i]='1';
	           // reverse(s.begin(),s.begin()+1+i);
	            ans=min(ans+a,ans+ b);
	            fl++;
	           // cout<<s<<" "<<an2<<endl;
	      }
	}
	if(fl==0){
	      cout<<0;
	      return;
	}
// 	cout<<an2<<" "<<an1<<endl;
cout<<ans;
// 	cout<<min(an2,an1);

}
int main(){
	FS;
	ll i,j,k,n,m,x,y,z,q;
	q=1;
	// cin>>q;
	while(q--){
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define pu push
#define bp __builtin_popcount
#define vsz(v) cout<<v.size()<<endl;
#define printv(v) for(ll i=0;i<v.size();i++)cout<<v[i]<<" "; cout<<endl;
#define printa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define printrv(v) for(ll i=v.size()-1;i>=0;i--)cout<<v[i]<<" "; cout<<endl;
#define printvpair(v) for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define vvpll vector<vector<pair<ll,ll>>>
#define qll queue<ll>
#define dqll deque<ll>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define vstr vector<string>
#define setpri(x) cout<<setprecision(x);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define scana(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define inf 1000000000000
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
	while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
	for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
	return ans;
}
ll ncrmod(ll n,ll r,ll mod){
	ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
	return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
	if(n==1 || r==0)return 1;
	ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=(((ans * n )/i)%mod);n--;sum+=ans;sum%=mod;}return sum;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true;
		for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
vll createprime(ll n){
	vector<bool> prime(n+1,true);vll ans;;prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	for(ll i=2;i<=n;i++)if(prime[i])ans.pb(i);
	return ans;
}
vbool createprimebool(ll n){
	vector<bool> prime(n+1,true);prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	return prime;
}
vll factor(ll n){
	vll ans;
	if(n>0)ans.pb(1);if(n==2)ans.pb(2);
	for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
	return ans;
}
ll numoffactor(ll n){ return factor(n).sz;}
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
	if(a.ff != b.ff)return a.ff < b.ff;
	return a.ss > b.ss;
}
void solve(){
	ll i,j,k,n,m,x,y,z,d,l,r;
	ll a,b;
	cin>>n>>a>>b;
	vll v;
	string s;
	cin>>s;
	ll c=1;
	for(i=1;i<n;i++){
	      if(s[i]==s[i-1])c++;
	      else{
	            v.pb(c);
	            c=1;
	      }
	}
	v.pb(c);
	ll an1=0;
	if(v.sz%2==0){
	      an1= (v.sz/2)*b;
	}else if(s[0]=='0'){
	      an1=(v.sz/2 +1)*b;
	}
	ll an2=b;
	ll ans=b;
	for(i=1;i<n;i++){
	      if(s[i]!=s[i-1]){
	            if(s[i]=='1')s[i]='0';
	            else s[i]='1';
	           // reverse(s.begin(),s.begin()+1+i);
	            ans=min(ans+a,ans+ b);
	           // cout<<s<<" "<<an2<<endl;
	      }
	}
// 	cout<<an2<<" "<<an1<<endl;
cout<<ans;
// 	cout<<min(an2,an1);

}
int main(){
	FS;
	ll i,j,k,n,m,x,y,z,q;
	q=1;
	// cin>>q;
	while(q--){
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define pu push
#define bp __builtin_popcount
#define vsz(v) cout<<v.size()<<endl;
#define printv(v) for(ll i=0;i<v.size();i++)cout<<v[i]<<" "; cout<<endl;
#define printa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define printrv(v) for(ll i=v.size()-1;i>=0;i--)cout<<v[i]<<" "; cout<<endl;
#define printvpair(v) for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define vvpll vector<vector<pair<ll,ll>>>
#define qll queue<ll>
#define dqll deque<ll>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define vstr vector<string>
#define setpri(x) cout<<setprecision(x);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define scana(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define inf 1000000000000
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
	while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
	for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
	return ans;
}
ll ncrmod(ll n,ll r,ll mod){
	ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
	return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
	if(n==1 || r==0)return 1;
	ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=(((ans * n )/i)%mod);n--;sum+=ans;sum%=mod;}return sum;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true;
		for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
vll createprime(ll n){
	vector<bool> prime(n+1,true);vll ans;;prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	for(ll i=2;i<=n;i++)if(prime[i])ans.pb(i);
	return ans;
}
vbool createprimebool(ll n){
	vector<bool> prime(n+1,true);prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	return prime;
}
vll factor(ll n){
	vll ans;
	if(n>0)ans.pb(1);if(n==2)ans.pb(2);
	for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
	return ans;
}
ll numoffactor(ll n){ return factor(n).sz;}
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
	if(a.ff != b.ff)return a.ff < b.ff;
	return a.ss > b.ss;
}
void solve(){
	ll i,j,k,n,m,x,y,z,d,l,r;
	ll a,b;
	cin>>n>>a>>b;
	vll v;
	string s;
	cin>>s;
	ll c=1;
	for(i=1;i<n;i++){
	      if(s[i]==s[i-1])c++;
	      else{
	            v.pb(c);
	            c=1;
	      }
	}
	v.pb(c);
	ll an1=0;
	if(v.sz%2==0){
	      an1= (v.sz/2)*b;
	}else if(s[0]=='0'){
	      an1=(v.sz/2 +1)*b;
	}
	ll an2=b;
	for(i=1;i<n;i++){
	      if(s[i]!=s[i-1]){
	           // reverse(s.begin(),s.begin()+1+i);
	            an2+=a;
	           // cout<<s<<" "<<an2<<endl;
	      }
	}
// 	cout<<an2<<" "<<an1<<endl;
	cout<<min(an2,an1);

}
int main(){
	FS;
	ll i,j,k,n,m,x,y,z,q;
	q=1;
	// cin>>q;
	while(q--){
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define pu push
#define bp __builtin_popcount
#define vsz(v) cout<<v.size()<<endl;
#define printv(v) for(ll i=0;i<v.size();i++)cout<<v[i]<<" "; cout<<endl;
#define printa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define printrv(v) for(ll i=v.size()-1;i>=0;i--)cout<<v[i]<<" "; cout<<endl;
#define printvpair(v) for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define vvpll vector<vector<pair<ll,ll>>>
#define qll queue<ll>
#define dqll deque<ll>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define vstr vector<string>
#define setpri(x) cout<<setprecision(x);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define scana(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define inf 1000000000000
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
	while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
	for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
	return ans;
}
ll ncrmod(ll n,ll r,ll mod){
	ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
	return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
	if(n==1 || r==0)return 1;
	ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=(((ans * n )/i)%mod);n--;sum+=ans;sum%=mod;}return sum;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true;
		for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
vll createprime(ll n){
	vector<bool> prime(n+1,true);vll ans;;prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	for(ll i=2;i<=n;i++)if(prime[i])ans.pb(i);
	return ans;
}
vbool createprimebool(ll n){
	vector<bool> prime(n+1,true);prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	return prime;
}
vll factor(ll n){
	vll ans;
	if(n>0)ans.pb(1);if(n==2)ans.pb(2);
	for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
	return ans;
}
ll numoffactor(ll n){ return factor(n).sz;}
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
	if(a.ff != b.ff)return a.ff < b.ff;
	return a.ss > b.ss;
}
void solve(){
	ll i,j,k,n,m,x,y,z,d,l,r;
	ll a,b;
	cin>>n>>a>>b;
	vll v;
	string s;
	cin>>s;
	ll c=1;
	for(i=1;i<n;i++){
	      if(s[i]==s[i-1])c++;
	      else{
	            v.pb(c);
	            c=1;
	      }
	}
	v.pb(c);
	ll an1=0;
	if(v.sz%2==0){
	      an1= (v.sz/2);
	}else if(s[0]=='0'){
	      an1=(v.sz/2 +1);
	}else{
	      an1=(v.sz/2);
	}
	if(an1==0){
	      cout<<0;
	      return;
	}
	ll an2=b;
	an2+= (an1-1)*(min(a,b));
	cout<<an2;

}
int main(){
	FS;
	ll i,j,k,n,m,x,y,z,q;
	q=1;
	// cin>>q;
	while(q--){
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define pu push
#define bp __builtin_popcount
#define vsz(v) cout<<v.size()<<endl;
#define printv(v) for(ll i=0;i<v.size();i++)cout<<v[i]<<" "; cout<<endl;
#define printa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
#define printrv(v) for(ll i=v.size()-1;i>=0;i--)cout<<v[i]<<" "; cout<<endl;
#define printvpair(v) for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;
#define sz size()
#define ff first
#define ss second
#define vll vector<ll>
#define vbool vector<bool>
#define vpll vector<pair<ll,ll>>
#define vvpll vector<vector<pair<ll,ll>>>
#define qll queue<ll>
#define dqll deque<ll>
#define pll pair<ll,ll>
#define vllv vector<vector<ll>>
#define vstr vector<string>
#define setpri(x) cout<<setprecision(x);
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define scana(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define inf 1000000000000
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
ll MOD=1e9+7;
ll ceil1(ll n,ll x){if(n%x==0)return n/x; else return (n/x)+1;}
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm;
}
ll pow2(ll n,ll k){ll ans=1;
	while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;
}
ll modinv(ll A,ll M){return pow1(A,M-2,M);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll factmod(ll n,ll mod){ll s=1; for(ll i=1;i<=n;i++){s*=i;s%=mod;} return s;}
vll fact1tonmod(ll n,ll mod){vll  ans(n+1);ans[0]=ans[1]=1;
	for(ll i=2;i<=n;i++)ans[i]=(ans[i-1]*i)%mod;
	return ans;
}
ll ncrmod(ll n,ll r,ll mod){
	ll ans=((((factmod(n,mod)%mod)*(modinv(factmod(r,mod),mod)%mod))%mod)*(modinv(factmod(n-r,mod),mod)))%mod;
	return ans;
}
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
	if(n==1 || r==0)return 1;
	ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=(((ans * n )/i)%mod);n--;sum+=ans;sum%=mod;}return sum;
}
bool isprime(ll n){if(n==1 || (n!=2 && n%2==0))return false; if(n==2)return true;
		for(ll i=3;i<=sqrt(n);i+=2)if(n%i==0)return false; return true; }
vll createprime(ll n){
	vector<bool> prime(n+1,true);vll ans;;prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	for(ll i=2;i<=n;i++)if(prime[i])ans.pb(i);
	return ans;
}
vbool createprimebool(ll n){
	vector<bool> prime(n+1,true);prime[0]=prime[1]=false;
	for(ll i=2;i*i<=n;i++)if(prime[i])for(ll j=i*i;j<=n;j+=i)prime[j]=false;
	return prime;
}
vll factor(ll n){
	vll ans;
	if(n>0)ans.pb(1);if(n==2)ans.pb(2);
	for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
	return ans;
}
ll numoffactor(ll n){ return factor(n).sz;}
bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
	if(a.ff != b.ff)return a.ff < b.ff;
	return a.ss > b.ss;
}
void solve(){
	ll i,j,k,n,m,x,y,z,d,l,r;
	ll a,b;
	cin>>n>>a>>b;
	vll v;
	string s;
	cin>>s;
	ll c=1;
	for(i=1;i<n;i++){
	      if(s[i]==s[i-1])c++;
	      else{
	            v.pb(c);
	            c=1;
	      }
	}
	v.pb(c);
	ll an1=0;
	if(v.sz%2==0){
	      an1= (v.sz/2)*b;
	}else if(s[0]=='0'){
	      an1=(v.sz/2 +1)*b;
	}
	ll an2=b;
	for(i=1;i<n;i++){
	      if(s[i]!=s[i-1]){
	            if(s[i]=='1')s[i]='0';
	            else s[i]='1';
	           // reverse(s.begin(),s.begin()+1+i);
	            an2+=a;
	           // cout<<s<<" "<<an2<<endl;
	      }
	}
// 	cout<<an2<<" "<<an1<<endl;
	cout<<min(an2,an1);

}
int main(){
	FS;
	ll i,j,k,n,m,x,y,z,q;
	q=1;
	// cin>>q;
	while(q--){
		solve();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,y;
string s;
long long solve0(){
	bool yes=1;
	long long crnt=0;
	for(int i=0;i<n;i++){
		if(yes==1 && s[i]=='0'){
			crnt++;
			yes=0;
		}
		else if(s[i]=='1') yes=1;
	}
	return crnt;
}
long long solve1(){
	bool yes=0;
	long long crnt=0;
	for(int i=0;i<n;i++){
		if(yes==0 && s[i]=='1'){
			crnt++;
			yes=1;
		}
		else if(s[i]=='0') yes=0;
	}
	if(s[0]=='1' || s[n-1]=='1') crnt--;
	return crnt;
}
int main(){
	cin>>n>>x>>y;
	cin>>s;
//	n=s.size();
	long long cmp0=solve0();
	long long cmp1=solve1();
	cout<<cmp0<<" "<<cmp1<<endl;
	long long ans1=cmp1*x+y;
	long long ans2=y*cmp0;
	cout<<min(ans1,ans2)<<endl;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,y;
string s;
long long solve0(){
	bool yes=1;
	long long crnt=0;
	for(int i=0;i<n;i++){
		if(yes==1 && s[i]=='0'){
			crnt++;
			yes=0;
		}
		else if(s[i]=='1') yes=1;
	}
	return crnt;
}
long long solve1(){
	bool yes=0;
	long long crnt=0;
	for(int i=0;i<n;i++){
		if(yes==0 && s[i]=='1'){
			crnt++;
			yes=1;
		}
		else if(s[i]=='0') yes=0;
	}
	crnt-=(s[0]=='1')+(s[n-1]=='1');
	if(crnt<0) crnt=0;
	return crnt;
}
int main(){
	cin>>n>>x>>y;
	cin>>s;
//	n=s.size();
	long long cmp0=solve0();
	long long cmp1=solve1();
//	cout<<cmp0<<" "<<cmp1<<endl;
	long long ans1=cmp1*x+y;
	long long ans2=y*cmp0;
	cout<<min(ans1,ans2)<<endl;
}