#include <bits/stdc++.h>
using namespace std;
long long n,x,y;
string s;
int main(){
	cin>>n>>x>>y;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='0') goto xxx;
	}
	cout<<0<<endl;
	exit(0);
	xxx:;
	if(x<y){
		bool yes=0;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				crnt++;
				yes=0;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<x*crnt+y<<endl;
	}
	else {
		bool yes=1;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				yes=0;
				crnt++;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<y*crnt<<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;
	}
	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;
int main(){
	cin>>n>>x>>y;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='0') goto xxx;
	}
	cout<<0<<endl;
	exit(0);
	xxx:;
	if(x<y){
		bool yes=0;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==0 && s[i]=='1'){
				crnt++;
				yes=0;
				continue;
			}
			if(s[i]=='0') yes=0;
		}
		cout<<x*(crnt-1)+y<<endl;
	}
	else {
		bool yes=1;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				yes=0;
				crnt++;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<y*crnt<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,y;
string s;
int main(){
	cin>>n>>x>>y;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='0') goto xxx;
	}
	cout<<0<<endl;
	exit(0);
	xxx:;
	if(x<y){
		bool yes=0;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==0 && s[i]=='1'){
				crnt++;
				yes=0;
				continue;
			}
			if(s[i]=='0') yes=0;
		}
		if(s[0]=='1') crnt--;
		cout<<x*crnt+y<<endl;
	}
	else {
		bool yes=1;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				yes=0;
				crnt++;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<y*crnt<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,y;
string s;
int main(){
	cin>>n>>x>>y;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='0') goto xxx;
	}
	cout<<0<<endl;
	exit(0);
	xxx:;
	if(x<y){
		bool yes=0;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==0 && s[i]=='1'){
				crnt++;
				yes=0;
				continue;
			}
			if(s[i]=='0') yes=0;
		}
		if(s[0]=='1') crnt--;
		else if(s[n-1]=='1') crnt--
		cout<<x*crnt+y<<endl;
	}
	else {
		bool yes=1;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				yes=0;
				crnt++;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<y*crnt<<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;
	}
	if(s[0]=='1' && s[n-1]=='1') crnt--;
	return crnt;
}
int main(){
	cin>>n>>x>>y;
	cin>>s;
	long long cmp0=solve0();
	long long cmp1=solve1();
	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');
	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;
int main(){
	cin>>n>>x>>y;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='0') goto xxx;
	}
	cout<<0<<endl;
	exit(0);
	xxx:;
	if(x<y){
		bool yes=0;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==0 && s[i]=='1'){
				crnt++;
				yes=1;
				continue;
			}
			if(s[i]=='0') yes=0;
		}
		if(s[0]=='1') crnt--;
		else if(s[n-1]=='1') crnt--;
		cout<<x*crnt+y<<endl;
	}
	else {
		bool yes=1;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				yes=0;
				crnt++;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<y*crnt<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,y;
string s;
int main(){
	cin>>n>>x>>y;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='0') goto xxx;
	}
	cout<<0<<endl;
	exit(0);
	xxx:;
	if(x<y){
		bool yes=0;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==0 && s[i]=='1'){
				crnt++;
				yes=0;
				continue;
			}
			if(s[i]=='0') yes=0;
		}
		if(s[0]=='1') crnt--;
		else if(s[n-1]=='1') crnt--;
		cout<<x*crnt+y<<endl;
	}
	else {
		bool yes=1;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				yes=0;
				crnt++;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<y*crnt<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,y;
string s;
int main(){
	cin>>n>>x>>y;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='0') goto xxx;
	}
	cout<<0<<endl;
	exit(0);
	xxx:;
	if(x<=y){
		bool yes=0;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				crnt++;
				yes=0;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<x*crnt+y<<endl;
	}
	else {
		bool yes=1;
		long long crnt=0;
		for(int i=0;i<n;i++){
			if(yes==1 && s[i]=='0'){
				yes=0;
				crnt++;
				continue;
			}
			if(s[i]=='1') yes=1;
		}
		cout<<y*crnt<<endl;
	}
}


#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define fi first
#define se second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define sz size()
#define PQ priority_queue
#define len length()
#define mll map<ll,ll>
#define vll vector<ll>
#define vpll vector<pair<ll,ll> >
#define mp(x,y)  make_pair(x,y)
#define pb push_back
#define pf push_front
#define ALL(v) v.begin(),v.end()
#define LAPAK ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

const ll MOD = 1e9 + 7;
const ll MAX = 1e6 + 5;

int main() {
    LAPAK
    //cout<<fixed<<setprecision(10);
	ll n,x,y;
	cin>>n>>x>>y;
	string s1,s2;
	cin>>s1;
	ll one = 0;
	For(i,0,n){
	    if(s1[i]=='0'){
	        if(one>0)s2.pb('1');
	        one = 0;
	        s2.pb('0');
	    }
	    else{
	        one = 1;
	    }
	}
	ll ans = 0;
	ld ones = 0;
	ones = count(ALL(s2),'1');
	if(s2[0]=='1')ones--;
	if(x<y)ans = ones*x + y;
	else ans = (ones+1)*y;
	if(ones==0 && count(ALL(s2),'0')==0)ans = 0;
	cout<<ans;

	return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define fi first
#define se second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define sz size()
#define PQ priority_queue
#define len length()
#define mll map<ll,ll>
#define vll vector<ll>
#define vpll vector<pair<ll,ll> >
#define mp(x,y)  make_pair(x,y)
#define pb push_back
#define pf push_front
#define ALL(v) v.begin(),v.end()
#define LAPAK ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

const ll MOD = 1e9 + 7;
const ll MAX = 1e6 + 5;

int main() {
    LAPAK
    //cout<<fixed<<setprecision(10);
	ll n,x,y;
	cin>>n>>x>>y;
	string s1,s2;
	cin>>s1;
	ll one = 0;
	For(i,0,n){
	    if(s1[i]=='0'){
	        if(one>0)s2.pb('1');
	        one = 0;
	        s2.pb('0');
	    }
	    else{
	        one = 1;
	    }
	}
	ll ans = 0;
	ld ones = 0;
	ones = count(ALL(s2),'1');
	if(s2[0]=='1')ones--;
	ans = (ceil(ones/2))*(min(x+y,y+y))+(((ll)ones%2==0 && ones>0)?y:0);
	cout<<ans;

	return 0;
}


V#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define fi first
#define se second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define sz size()
#define PQ priority_queue
#define len length()
#define mll map<ll,ll>
#define vll vector<ll>
#define vpll vector<pair<ll,ll> >
#define mp(x,y)  make_pair(x,y)
#define pb push_back
#define pf push_front
#define ALL(v) v.begin(),v.end()
#define LAPAK ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

const ll MOD = 1e9 + 7;
const ll MAX = 1e6 + 5;

int main() {
    LAPAK
    //cout<<fixed<<setprecision(10);
	ll n,x,y;
	cin>>n>>x>>y;
	string s1,s2;
	cin>>s1;
	ll one = 0;
	For(i,0,n){
	    if(s1[i]=='0'){
	        if(one>0)s2.pb('1');
	        one = 0;
	        s2.pb('0');
	    }
	    else{
	        one = 1;
	    }
	}
	ll ans = 0;
	ld ones = 0;

	cout<<s2<<endl;
	ones = count(ALL(s2),'1');
	if(s2[0]=='1')ones--;
	ans = (ceil(ones/2))*(min(x+y,y+y))+(((ll)ones%2==0 && ones>0)?y:0);
	cout<<ans;

	return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define fi first
#define se second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define sz size()
#define PQ priority_queue
#define len length()
#define mll map<ll,ll>
#define vll vector<ll>
#define vpll vector<pair<ll,ll> >
#define mp(x,y)  make_pair(x,y)
#define pb push_back
#define pf push_front
#define ALL(v) v.begin(),v.end()
#define LAPAK ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

const ll MOD = 1e9 + 7;
const ll MAX = 1e6 + 5;

int main() {
    LAPAK
    //cout<<fixed<<setprecision(10);
	ll n,x,y;
	cin>>n>>x>>y;
	string s1,s2;
	cin>>s1;
	ll one = 0;
	For(i,0,n){
	    if(s1[i]=='0'){
	        if(one>0)s2.pb('1');
	        one = 0;
	        s2.pb('0');
	    }
	    else{
	        one = 1;
	    }
	}
	ll ans = 0;
	ld ones = 0;
	ones = count(ALL(s2),'1');
	if(s2[0]=='1')ones--;
	ans = (ceil(ones/2))*(min(x+y,y+y))+(((ll)ones%2==0 && ones>0)?y:0);
	if(ones==0)ans = y;
	cout<<ans;

	return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define fi first
#define se second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define sz size()
#define PQ priority_queue
#define len length()
#define mll map<ll,ll>
#define vll vector<ll>
#define vpll vector<pair<ll,ll> >
#define mp(x,y)  make_pair(x,y)
#define pb push_back
#define pf push_front
#define ALL(v) v.begin(),v.end()
#define LAPAK ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

const ll MOD = 1e9 + 7;
const ll MAX = 1e6 + 5;

int main() {
    LAPAK
    //cout<<fixed<<setprecision(10);
	ll n,x,y;
	cin>>n>>x>>y;
	string s1,s2;
	cin>>s1;
	ll one = 0;
	For(i,0,n){
	    if(s1[i]=='0'){
	        if(one>0)s2.pb('1');
	        one = 0;
	        s2.pb('0');
	    }
	    else{
	        one = 1;
	    }
	}
	ll ans = 0;
	ld ones = 0;
	ones = count(ALL(s2),'1');
	if(s2[0]=='1')ones--;
	ans = (ceil(ones/2))*(min(x+y,y+y))+(((ll)ones%2==0 && ones>0)?y:0);
	if(ones==0 && count(ALL(s2),'0')>0)ans = y;
	cout<<ans;

	return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define fi first
#define se second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define sz size()
#define PQ priority_queue
#define len length()
#define mll map<ll,ll>
#define vll vector<ll>
#define vpll vector<pair<ll,ll> >
#define mp(x,y)  make_pair(x,y)
#define pb push_back
#define pf push_front
#define ALL(v) v.begin(),v.end()
#define LAPAK ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

const ll MOD = 1e9 + 7;
const ll MAX = 1e6 + 5;

int main() {
    LAPAK
    //cout<<fixed<<setprecision(10);
	ll n,x,y;
	cin>>n>>x>>y;
	string s1;
	cin>>s1;
	ll zeros = 0;
	For(i,0,n-1){
	    if(s1[i]=='0'&& s1[i+1]=='1'){
	        zeros++;
	    }
	}
	if(s1[n-1]=='0')zeros++;
	ll ans = 0;
    ans = min((zeros-1)*x + y,zeros*y);

	cout<<max(ans,0);

	return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define fi first
#define se second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define sz size()
#define PQ priority_queue
#define len length()
#define mll map<ll,ll>
#define vll vector<ll>
#define vpll vector<pair<ll,ll> >
#define mp(x,y)  make_pair(x,y)
#define pb push_back
#define pf push_front
#define ALL(v) v.begin(),v.end()
#define LAPAK ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

const ll MOD = 1e9 + 7;
const ll MAX = 1e6 + 5;

int main() {
    LAPAK
    //cout<<fixed<<setprecision(10);
	ll n,x,y;
	cin>>n>>x>>y;
	string s1;
	cin>>s1;
	ll zeros = 0;
	For(i,0,n-1){
	    if(s1[i]=='0'&& s1[i+1]=='1'){
	        zeros++;
	    }
	}
	if(s1[n-1]=='0')zeros++;
	ll ans = 0;
    ans = min((zeros-1)*x + y,zeros*y);

	cout<<max(ans,0ll);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef int ll;
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<n;i++)
#define pa pair<int,int>
#define vec vector<int>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define clr(x) memset(x, 0, sizeof(x))
#define init(x, a) memset(x, a, sizeof(x))
ll inf = (ll)1e18;
ll mod = 1000000001;
ll max1 = (ll)1e9;
int main() {
#ifndef ONLINE_JUDGE
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/input.txt", "r", stdin);
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/output.txt", "w", stdout);
	//freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/err.txt", "w", stderr);
#endif
	ll i, j, k, n, m, ct = 0, t, ans = 0, x, y;
	cin >> n >> x >> y;
	ll reversal = 0, a[n], flag = 0; j = -1;
	for (i = 0; i < n; i++) scanf("%1d", &a[i]);
	for (i = 0; i < n; i++) {
		if (a[i] == 0 && flag == 0) {j = i; flag = 1;}
		else if (a[i] == 0 && flag == 1 && j != i - 1) {
			reversal++;
			j = i;
		}
		else if (a[i] == 0) j = i;
	}
	for (i = 1; i < n; i++) {
		if (a[i - 1] != a[i]) ct++;
	}
	ll cost1 = reversal * x + y;
	ll cost2 = (reversal + 1) * y;
	cout << min(cost1, cost2) << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<n;i++)
#define pa pair<int,int>
#define vec vector<int>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define clr(x) memset(x, 0, sizeof(x))
#define init(x, a) memset(x, a, sizeof(x))
ll inf = (ll)1e18;
ll mod = 1000000001;
ll max1 = (ll)1e9;
int main() {
#ifndef ONLINE_JUDGE
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/input.txt", "r", stdin);
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/output.txt", "w", stdout);
	//freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/err.txt", "w", stderr);
#endif
	ll i, j, k, n, m, ct = 0, t, ans = 0, x, y;
	cin >> n >> x >> y;
	ll reversal = 0, a[n], flag = 0; j = -1;
	for (i = 0; i < n; i++) scanf("%1lld", &a[i]);
	for (i = 0; i < n; i++) {
		if (a[i] == 0 && flag == 0) {j = i; flag = 1;}
		else if (a[i] == 0 && flag == 1 && j != i - 1) {
			reversal++;
			j = i;
		}
		else if (a[i] == 0) j = i;
		else if (a[i] == 1) ct++;
	}
	for (i = 1; i < n; i++) {
		if (a[i - 1] != a[i]) ct++;
	}
	//cout << reversal << endl;
	ll cost1 = (reversal) * x + y;
	ll cost2 = (reversal + 1) * y;
	if (ct == n) cout << "0";
	else cout << min(cost1, cost2) << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<n;i++)
#define pa pair<int,int>
#define vec vector<int>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define clr(x) memset(x, 0, sizeof(x))
#define init(x, a) memset(x, a, sizeof(x))
ll inf = (ll)1e18;
ll mod = 1000000001;
ll max1 = (ll)1e9;
int main() {
#ifndef ONLINE_JUDGE
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/input.txt", "r", stdin);
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/output.txt", "w", stdout);
	//freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/err.txt", "w", stderr);
#endif
	ll i, j, k, n, m, ct = 0, t, ans = 0, x, y;
	cin >> n >> x >> y;
	ll reversal = 0, a[n], flag = 0; j = -1;
	for (i = 0; i < n; i++) scanf("%1lld", &a[i]);
	for (i = 0; i < n; i++) {
		if (a[i] == 0 && flag == 0) {j = i; flag = 1;}
		else if (a[i] == 0 && flag == 1 && j != i - 1) {
			reversal++;
			j = i;
		}
		else if (a[i] == 0) j = i;
	}
	for (i = 1; i < n; i++) {
		if (a[i - 1] != a[i]) ct++;
	}
	ll cost1 = reversal * x + y;
	ll cost2 = (reversal + 1) * y;
	if (reversal == 0) cout << "0";
	else
		cout << min(cost1, cost2) << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef int ll;
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<n;i++)
#define pa pair<int,int>
#define vec vector<int>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define clr(x) memset(x, 0, sizeof(x))
#define init(x, a) memset(x, a, sizeof(x))
ll inf = (ll)1e18;
ll mod = 1000000001;
ll max1 = (ll)1e9;
int main() {
#ifndef ONLINE_JUDGE
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/input.txt", "r", stdin);
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/output.txt", "w", stdout);
	//freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/err.txt", "w", stderr);
#endif
	ll i, j, k, n, m, ct = 0, t, ans = 0, x, y;
	cin >> n >> x >> y;
	ll reversal = 0, a[n], flag = 0; j = -1;
	for (i = 0; i < n; i++) scanf("%1d", &a[i]);
	for (i = 0; i < n; i++) {
		if (a[i] == 0 && flag == 0) {j = i; flag = 1;}
		else if (a[i] == 0 && flag == 1 && j != i - 1) {
			reversal++;
			j = i;
		}
		else if (a[i] == 0) j = i;
	}
	for (i = 1; i < n; i++) {
		if (a[i - 1] != a[i]) ct++;
	}
	ll cost1 = reversal * x + y;
	ll cost2 = (reversal + 1) * y;
	if (reversal == 0) cout << "0";
	else
		cout << min(cost1, cost2) << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<n;i++)
#define pa pair<int,int>
#define vec vector<int>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define clr(x) memset(x, 0, sizeof(x))
#define init(x, a) memset(x, a, sizeof(x))
ll inf = (ll)1e18;
ll mod = 1000000001;
ll max1 = (ll)1e9;
int main() {
#ifndef ONLINE_JUDGE
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/input.txt", "r", stdin);
	freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/output.txt", "w", stdout);
	//freopen("C:/Users/Utkarsh Kumar Singh/Desktop/ALL CODE/err.txt", "w", stderr);
#endif
	ll i, j, k, n, m, ct = 0, t, ans = 0, x, y;
	cin >> n >> x >> y; ll kt = 0;
	ll reversal = 0, a[n], flag = 0; j = -1;
	for (i = 0; i < n; i++) scanf("%1lld", &a[i]);
	for (i = 0; i < n; i++) {
		if (a[i] == 0 && flag == 0) {j = i; flag = 1;}
		else if (a[i] == 0 && flag == 1 && j != i - 1) {
			reversal++;
			j = i;
		}
		else if (a[i] == 0) j = i;
		else if (a[i] == 1) kt++;
	}
	for (i = 1; i < n; i++) {
		if (a[i - 1] != a[i]) ct++;
	}
	//cout << reversal << endl;
	ll cost1 = (reversal) * x + y;
	ll cost2 = (reversal + 1) * y;
	if (kt == n) cout << "0";
	else cout << min(cost1, cost2) << endl;
	return 0;
}


#include <iostream>

using namespace std;

int main()
{

    long long n, x, y;
    string s;
    cin >> n >> x >> y >> s;
    s += 1;
    int cnt = 0;

    for (int i = 1; i < s.size() - 1; i++)
    {
        if (s[i] == '1' && s[i - 1] == '0')
        {
            cnt++;
        }
    }
    if (cnt == 0)
    {
        cout << 0;
    }
    else
    {
        cout << (cnt)*min(x, y) + y;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{

    int n, x, y;
    string s;
    cin >> n >> x >> y >> s;
    s += 1;
    int cnt = 0;

    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '0' && s[i + 1] == '1')
        {
            cnt++;
        }
    }
    if (cnt == 0)
    {
        cout << 0;
    }
    else
    {
        cout << cnt*min(x,y) + y;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{

    long long n, x, y;
    string s;
    cin >> n >> x >> y >> s;
    s += 1;
    int cnt = 0;

    for (int i = 1; i < s.size() - 1; i++)
    {
        if (s[i] == '1' && s[i - 1] == '0')
        {
            cnt++;
        }
    }
    cout << cnt << endl;
    if (cnt == 0)
    {
        cout << 0;
    }
    else
    {
        cout << (cnt)*min(x, y) + y;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{

    long long n, x, y;
    string s;
    cin >> n >> x >> y >> s;
    s += 1;
    int cnt = 0;

    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '0' && s[i + 1] == '1')
        {
            cnt++;
        }
    }
    if (cnt == 0)
    {
        cout << 0;
    }
    else
    {
        cout << cnt*min(x,y) + y;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{

    long long n, x, y;
    string s;
    cin >> n >> x >> y >> s;
    s += "1";
    int cnt = 0;

    for (int i = 1; i < s.size(); i++)
    {
        if (s[i] == '1' && s[i - 1] == '0')
        {
            cnt++;
        }
    }
    if (cnt == 0)
    {
        cout << 0;
    }
    else
    {
        cout << (cnt -1 )*min(x, y) + y;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{

    long long n, x, y;
    string s;
    cin >> n >> x >> y >> s;
    s += 1;
    int cnt = 0;

    for (int i = 1; i < s.size() - 1; i++)
    {
        if (s[i] == '0' && s[i - 1] == '1')
        {
            cnt++;
        }
    }
    if (cnt == 0)
    {
        cout << 0;
    }
    else
    {
        cout << (cnt)*min(x, y) + y;
    }
    return 0;
}


#include <iostream>
using namespace std;
using ll = long long;

int main() {
    int n;
    ll x, y;
    cin >> n >> x >> y;
    char prev;
    cin >> prev;
    ll blocks_zero = (prev == '0');
    for (int i = 1; i < n; ++i)
    {
        char c;
        cin >> c;
        blocks_zero += (c == '0' && prev == '1');
    }
    if (blocks_zero == 0)
        cout  << 0;
    else
        cout << min(x, y) * blocks_zero + y;

    return 0;
}


#include <iostream>
using namespace std;
using ll = long long;

int main() {
    int n;
    ll x, y;
    cin >> n >> x >> y;
    char prev;
    cin >> prev;
    ll blocks_zero = (prev == '0');
    for (int i = 1; i < n; ++i)
    {
        char c;
        cin >> c;
        blocks_zero += (c == '0' && prev == '1');
        prev = c;
    }
    if (blocks_zero == 0)
        cout  << 0;
    else
        cout << min(x, y) * (blocks_zero - 1) + y;

    return 0;
}


#include <iostream>
using namespace std;
using ll = long long;

int main() {
    int n;
    ll x, y;
    cin >> n >> x >> y;
    char prev;
    cin >> prev;
    ll blocks_zero = (prev == '0');
    for (int i = 1; i < n; ++i)
    {
        char c;
        cin >> c;
        blocks_zero += (c == '0' && prev == '1');
    }
    if (blocks_zero == 0)
        cout  << 0;
    else
        cout << min(x, y) * --blocks_zero + y;

    return 0;
}


#include <iostream>
using namespace std;

int main() {
    int n, x, y;
    cin >> n >> x >> y;
    char prev;
    cin >> prev;
    int blocks_zero = (prev == '0');
    for (int i = 1; i < n; ++i)
    {
        char c;
        cin >> c;
        blocks_zero += (c == '0' && prev == '1');
    }
    if (blocks_zero == 0)
        cout  << 0;
    else
        cout << min(x, y) * blocks_zero + y;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define bp push_back
#define pause; system("pause");
#define mp make_pair
const int N=3e5+10;
const double eps=1e-9;
const int inf=1e9;
char a[N];
bool vis[N];
vector<pair<int,int> >v;
main(){

    int n,x,y;
    ll ans=0;
    scanf("%d%d%d%s",&n,&x,&y,a);
    for(int i=0;i<n;i++){
        int j=i;
        while(j<n && a[j]=='0')++j;
        --j;
        if(i<=j){
            v.bp({i,j});
            i=j;
        }
    }
    int sz=v.size();
    if((int)v.size()==1){
        printf("%d",y);
        return 0;
    }
    for(int i=1;i<sz;i++){
        if(ans+x+y<=ans+y+y){
            ans+=x+y;
        }
        else{
            ans+=y+y;
            ++i;
        }
    }
    printf("%lld",ans);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define bp push_back
#define pause; system("pause");
#define mp make_pair
const int N=3e5+10;
const double eps=1e-9;
const int inf=1e9;
char a[N];
bool vis[N];
vector<pair<int,int> >v;
main(){

    int n,x,y;
    ll ans=0;
    scanf("%d%d%d%s",&n,&x,&y,a);

    for(int i=0;i<n;i++){
        int j=i;
        while(j<n && a[j]=='0')++j;
        --j;
        if(i<=j){
            v.bp({i,j});
            i=j;
        }
    }
    int sz=v.size();
    if((int)v.size()==1){
        printf("%d",y);
        return 0;
    }
    for(int i=1;i<sz;i++){
        int j=i;
        while(j<sz && 1ll*x*(j)<=1ll*(j+1)*y)++j;
        int tmp=j-i+1;
        if(tmp==1){
            ans+=y;
            if(i==1)ans+=y;
        }
        else ans+=(1ll*(tmp-1)*x)+y;
    }
    printf("%lld",ans);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define bp push_back
#define pause; system("pause");
#define mp make_pair
const int N=3e5+10;
const double eps=1e-9;
const int inf=1e9;
char a[N];
bool vis[N];
vector<pair<int,int> >v;
main(){

    int n,x,y;
    ll ans=0;
    scanf("%d%d%d%s",&n,&x,&y,a);

    for(int i=0;i<n;i++){
        int j=i;
        while(j<n && a[j]=='0')++j;
        --j;
        if(i<=j){
            v.bp({i,j});
            i=j;
        }
    }
    int sz=v.size();
    if((int)v.size()==1){
        printf("%d",y);
        return 0;
    }
    for(int i=1;i<sz;i++){
        int j=i;
        while(j<sz && 1ll*x*(j)<=1ll*(j+1)*y)++j;
        int tmp=j-i+1;
        ans+=(1ll*(tmp-1)*x)+y;
    }
    printf("%lld",ans);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define bp push_back
#define pause; system("pause");
#define mp make_pair
const int N=3e5+10;
const double eps=1e-9;
const int inf=1e9;
char a[N];
bool vis[N];
vector<pair<int,int> >v;
main(){

    int n,x,y;
    scanf("%d%d%d%s",&n,&x,&y,a);
    for(int i=0;i<n;i++){
        int j=i;
        while(j<n && a[j]=='0')++j;
        --j;
        if(i<=j){
            v.bp({i,j});
            i=j;
        }
    }
    int sz=v.size();
    if((int)v.size()==1){
        printf("%d",y);
        return 0;
    }
    ll ans=1ll*(sz-1)*min(x,y)+y;

    printf("%lld",ans);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define bp push_back
#define pause; system("pause");
#define mp make_pair
const int N=3e5+10;
const double eps=1e-9;
const int inf=1e9;
char a[N];
bool vis[N];
vector<pair<int,int> >v;
main(){

    int n,x,y;
    ll ans=0;
    scanf("%d%d%d%s",&n,&x,&y,a);
    for(int i=0;i<n;i++){
        int j=i;
        while(j<n && a[j]=='0')++j;
        --j;
        if(i<=j){
            v.bp({i,j});
            i=j;
        }
    }
    int sz=v.size();
    if((int)v.size()==1){
        printf("%d",y);
        return 0;
    }
    for(int i=0;i<sz;i++){
        ll sum=0;
        while(i<sz && sum+x<=y){
            sum+=x;
            ++i;
        }
        sum-=x;
        sum=max(sum,0ll);
        ans+=y+sum;
    }
    printf("%lld",ans);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define bp push_back
#define pause; system("pause");
#define mp make_pair
const int N=3e5+10;
const double eps=1e-9;
const int inf=1e9;
char a[N];
bool vis[N];
vector<pair<int,int> >v;
main(){

    int n,x,y;
    scanf("%d%d%d%s",&n,&x,&y,a);
    for(int i=0;i<n;i++){
        int j=i;
        while(j<n && a[j]=='0')++j;
        --j;
        if(i<=j){
            v.bp({i,j});
            i=j;
        }
    }
    int sz=v.size();
    if((int)v.size()==0){
        printf("0");
        return 0;
    }
    ll ans=1ll*(sz-1)*min(x,y)+y;

    printf("%lld",ans);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define bp push_back
#define pause; system("pause");
#define mp make_pair
const int N=3e5+10;
const double eps=1e-9;
const int inf=1e9;
char a[N];
bool vis[N];
vector<pair<int,int> >v;
main(){

    int n,x,y;
    ll ans=0;
    scanf("%d%d%d%s",&n,&x,&y,a);
    for(int i=0;i<n;i++){
        int j=i;
        while(j<n && a[j]=='0')++j;
        --j;
        if(i<=j){
            v.bp({i,j});
            i=j;
        }
    }
    int sz=v.size();
    if((int)v.size()==1){
        printf("%d",y);
        return 0;
    }
    for(int i=1;i<sz;i++){
        if(ans+x+y<=ans+y+y){
            ans+=x+y;
        }
        else{
            ans+=y+y;

        }
    }
    printf("%lld",ans);
}


#include<bits/stdc++.h>
using namespace std;
int n,a,b,i,cnt;
string s;
int main()
{
    cin >> n >> a >> b >> s;
    s = "1"+s+"1";
    for(i = 1 ; i < s.size() ; i++)
        if(s[i-1] == '1' && s[i] == '0') cnt++;// count the period
    cnt ? cout << min(a,b)*(cnt-1) + b : cout << 0;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a,b,i,cnt;
string s;
int main()
{
    cin >> n >> a >> b >> s;
    s = "1"+s+"1";
    for(int i = 1 ; i < n ; i++)
        if(s[i-1] == '1' && s[i] == '0') cnt++;// count the period
    cnt ? cout << min(a,b)*(cnt-1) + b : cout << 0;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a,b,i,cnt;
string s;
int main()
{
    cin >> n >> a >> b >> s;
    s = "1"+s+"1";
    for(int i = 1 ; i < s.size() ; i++)
        if(s[i-1] == '1' && s[i] == '0') cnt++;// count the period
    cnt ? cout << min(a,b)*(cnt-1) + b : cout << 0;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a,b,i,cnt;
string s;
int main()
{
    cin >> n >> a >> b >> s;
    s = "1"+s+"1";
    for(int i = 1 ; i < n ; i++)
        if(s[i-1] == '1' && s[i] == '0') cnt++;// count the period
    cnt ? cout << min(a,b)*(cnt) + b : cout << 0;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long int n,a,b,i,cnt;
string s;
int main()
{
    cin >> n >> a >> b >> s;
    s = "1"+s+"1";
    for(i = 1 ; i < s.size() ; i++)
        if(s[i-1] == '1' && s[i] == '0') cnt++;// count the period
    cnt ? cout << min(a,b)*(cnt-1) + b : cout << 0;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a,b,i,cnt;
string s;
int main()
{
    cin >> n >> a >> b >> s;
    //s = "1"+s+"1";
    for(int i = 1 ; i < n ; i++)
        if(s[i-1] == '1' && s[i] == '0') cnt++;// count the period
    cnt ? cout << min(a,b)*(cnt) + b : cout << 0;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=1e8+1;
 int n,x,y,part(0);
 char a[N];
 long long ans;
 int main()
 {

     cin>>n>>x>>y;
     cin>>a+1;
     a[n+1]='1';
     ans=1LL<<60;
     for(int i=1;i<=n;++i)
     {
     	if(a[i]== '1')
     	{
     		continue;
     	}
     	int k=i;
     	while(a[k+1]=='0')
     	{
     		++k;
     	}
     	++part;
     	i=k;
     }
    if(!part){
      cout<<"0";
      return 0;
     }
     for(int i=0;i<part;++i){

     	ans=min(ans,1LL*i*x+1LL*(part-1LL*i)*y);
     }
     cout<<ans;

 }


#include <bits/stdc++.h>
using namespace std;
const int N=1e8+1;
 int n,x,y,part(0);
 char a[N];
 long long ans;
 int main()
 {

     cin>>n>>x>>y;
     cin>>a+1;
     a[n]='1';
     ans=1LL<<50;
     for(int i=0;i<n;++i)
     {
     	if(a[i]== '1')
     	{
     		continue;
     	}
     	int k=i;
     	while(a[k+1]=='0')
     	{
     		++k;
     	}
     	++part;
     	i=k;
     }
    if(!part){
      cout<<"0";
      return 0;
     }
     for(int i=0;i<part;++i){

     	ans=min(ans,1LL*i*x+1LL*(part-1LL*i)*y);
     }
     cout<<ans;

 }


#include <bits/stdc++.h>
using namespace std;
const int N=1e5+1;
 int n,x,y,part(0);
 char a[N];
 long long ans;
 int main()
 {

     cin>>n>>x>>y;
     cin>>a;

     ans=1LL<<50;
     for(int i=0;i<n;i++)
     {
     	if(a[i]== '1')
     	{
     		continue;
     	}
     	int k=i;
     	while(a[k+1]=='0')
     	{
     		k++;
     	}
     	part++;
     	i=k;
     }
   /*  if(!part){
      cout<<"0";
      return 0;
     }
     for(int i=0;i<part;i++){

     	ans=min(ans,1LL*i*x+(part-1LL*i)*y);
     }
     cout<<ans;
     */
     cout<<part;
 }


#include <bits/stdc++.h>
using namespace std;
const int N=1e5+1;
 int n,x,y,part(0);
 char a[N];
 long long ans;
 int main()
 {

     cin>>n>>x>>y;
     cin>>a;
     a[n+1]='1';
     ans=1LL<<50;
     for(int i=0;i<n;i++)
     {
     	if(a[i]== '1')
     	{
     		continue;
     	}
     	int k=i;
     	while(a[k+1]=='0')
     	{
     		k++;
     	}
     	part++;
     	i=k;
     }
    if(!part){
      cout<<"0";
      return 0;
     }
     for(int i=0;i<part;i++){

     	ans=min(ans,1LL*i*x+(part-1LL*i)*y);
     }
     cout<<ans;

 }


#include <bits/stdc++.h>
using namespace std;
const int N=1e5+1;
 int n,x,y,part(0);
 char a[N];
 long long ans;
 int main()
 {

     cin>>n>>x>>y;
     cin>>a;
     ans=1LL<<50;
     for(int i=1;i<=n;i++)
     {
     	if(a[i]== '1')
     	{
     		continue;
     	}
     	int k=i;
     	while(a[k+1]=='0')
     	{
     		k++;
     	}
     	part++;
     	i=k;
     }
     for(int i=0;i<part;i++){

     	ans=min(ans,1LL*i*x+(part-1LL*i)*y);
     }
     cout<<ans;
 }


#include <bits/stdc++.h>
using namespace std;
const int N=1e5+1;
 int n,x,y,part(0);
 char a[N];
 long long ans;
 int main()
 {

     cin>>n>>x>>y;
     cin>>a;
     a[n+1]='1';
     ans=1LL<<60;
     for(int i=0;i<n;i++)
     {
     	if(a[i]== '1')
     	{
     		continue;
     	}
     	int k=i;
     	while(a[k+1]=='0')
     	{
     		k++;
     	}
     	part++;
     	i=k;
     }
    if(!part){
      cout<<"0";
      return 0;
     }
     for(int i=0;i<part;i++){

     	ans=min(ans,1LL*i*x+(part-1LL*i)*y);
     }
     cout<<ans;

 }


#include <bits/stdc++.h>
using namespace std;
const int N=1e5+1;
 int n,x,y,part(0);
 char a[N];
 long long ans;
 int main()
 {

     cin>>n>>x>>y;
     cin>>a;
     a[n+1]='1';
     ans=1LL<<50;
     for(int i=0;i<n;i++)
     {
     	if(a[i]== '1')
     	{
     		continue;
     	}
     	int k=i;
     	while(a[k+1]=='0')
     	{
     		k++;
     	}
     	part++;
     	i=k;
     }
    if(!part){
      cout<<"0";
      return 0;
     }
     for(int i=0;i<part;i++){

     	ans=min(ans,1LL*i*x+1LL*(part-1LL*i)*y);
     }
     cout<<ans;

 }


/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug1(a,n)  loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  3.1415926535; //acos((ld) - 1);

ll cnt_0islands(string s, ll n)
{
	ll pre[n + 1];	fill(pre, 0);
	loop(i, 0, n)		if (s[i] == '1')	pre[i + 1]++;
	loop(i, 1, n + 1)	pre[i] += pre[i - 1];
	ll cnt = 0, flg = 1;
	loop(i, 1, n + 1)
	{
		if (pre[i] == pre[i - 1] && flg)
		{
			cnt++;
			flg = 0;
		}
		if (pre[i] != pre[i - 1])	flg = 1;
	}
	// cout << cnt << nl;
	return cnt;
}

ll cnt_reverse(string s, ll n)
{
	ll i = 0, ans = 0, flg = 0;
	while (i < n)
	{
		while (i < n && s[i] == '0')
		{
			i++;
			flg = 1;
		}
		if (flg && i < n)
		{
			ans++;
			i--;
		}
		flg = 0;
		i++;
	}
	// cout << s << " " << ans << nl;
	return ans;
}

void solve()
{
	ll n, x, y;		cin >> n >> x >> y;
	string s;		cin >> s;

	string p;	rloop(i, n - 1, 0)	p += s[i];
	ll ans;
	ans = min(x * min(cnt_reverse(s, n), cnt_reverse(p, n)) + y, y * cnt_0islands(s, n));
	ll cnt = count(all(s), '0'), num = 0;
	if (cnt != n)
	{
		if (s[0] == '0' && s[n - 1] == '0')	num = 2;
		else if (s[0] == '0' || s[n - 1] == '0')	num = 1;
		ans = min((x * (min(cnt_reverse(s, n), cnt_reverse(p, n))) - num) + y + num * y, ans);
		ans=max(ans,0ll);
	}
	cout << ans;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}


/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug1(a,n)  loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  3.1415926535; //acos((ld) - 1);

ll cnt_0islands(string s, ll n)
{
	ll pre[n + 1];	fill(pre, 0);
	loop(i, 0, n)		if (s[i] == '1')	pre[i + 1]++;
	loop(i, 1, n + 1)	pre[i] += pre[i - 1];
	ll cnt = 0, flg = 1;
	loop(i, 1, n + 1)
	{
		if (pre[i] == pre[i - 1] && flg)
		{
			cnt++;
			flg = 0;
		}
		if (pre[i] != pre[i - 1])	flg = 1;
	}
	// cout << cnt << nl;
	return cnt;
}

ll cnt_reverse(string s, ll n)
{
	ll i = 0, ans = 0, flg = 0;
	while (i < n)
	{
		while (i < n && s[i] == '0')
		{
			i++;
			flg = 1;
		}
		if (flg && i < n)
		{
			ans++;
			// i--;
		}
		flg = 0;
		i++;
	}
	cout << s << " " << ans << nl;
	return ans;
}

void solve()
{
	ll n, x, y;		cin >> n >> x >> y;
	string s;		cin >> s;

	string p;	rloop(i, n - 1, 0)	p += s[i];
	ll ans = min(x * min(cnt_reverse(s, n), cnt_reverse(p, n)) + y, y * cnt_0islands(s, n));
	cout << ans;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}


/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug1(a,n)  loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  3.1415926535; //acos((ld) - 1);

ll cnt_0islands(string s, ll n)
{
	ll pre[n + 1];	fill(pre, 0);
	loop(i, 0, n)		if (s[i] == '1')	pre[i + 1]++;
	loop(i, 1, n + 1)	pre[i] += pre[i - 1];
	ll cnt = 0, flg = 1;
	loop(i, 1, n + 1)
	{
		if (pre[i] == pre[i - 1] && flg)
		{
			cnt++;
			flg = 0;
		}
		if (pre[i] != pre[i - 1])	flg = 1;
	}
	// cout << cnt << nl;
	return cnt;
}

ll cnt_reverse(string s, ll n)
{
	ll i = 0, ans = 0, flg = 0;
	// loop(j, 0, n)		if (s[j] == '1') {	i = j;	break;	}
	while (i < n)
	{
		while (i < n && s[i] == '0')
		{
			i++;
			flg = 1;
		}
		if (flg && i < n)
		{
			ans++;
			i--;
		}
		flg = 0;
		i++;
	}
	// cout << s << " " << ans << nl;
	return ans;
}

void solve()
{
	ll n, x, y;		cin >> n >> x >> y;
	string s;		cin >> s;

	string p;	rloop(i, n - 1, 0)	p += s[i];
	ll ans = min(x * min(cnt_reverse(s, n), cnt_reverse(p, n)) + y, y * cnt_0islands(s, n));
	cout << ans;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}


/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug1(a,n)  loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  3.1415926535; //acos((ld) - 1);

ll cnt_0islands(string s, ll n)
{
	ll cnt = 0, flg = 1;
	loop(i, 0, n)
	{
		if (s[i] == '0' && flg)
		{
			cnt++;
			flg = 0;
		}
		if (s[i] == '1')	flg = 1;
	}
	// cout << cnt << nl;
	return cnt;
}

void solve()
{
	ll n, x, y;		cin >> n >> x >> y;
	string s;		cin >> s;

	ll cnt = cnt_0islands(s, n);
	ll ans = y * cnt;
	loop(i, 1, cnt)
	{
		ans = min(ans, y * (cnt - i) + x * i);
	}
	cout << ans;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}


/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug1(a,n)  loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  3.1415926535; //acos((ld) - 1);

ll cnt_0islands(string s, ll n)
{
	ll pre[n + 1];	fill(pre, 0);
	loop(i, 0, n)		if (s[i] == '1')	pre[i + 1]++;
	loop(i, 1, n + 1)	pre[i] += pre[i - 1];
	ll cnt = 0, flg = 1;
	loop(i, 1, n + 1)
	{
		if (pre[i] == pre[i - 1] && flg)
		{
			cnt++;
			flg = 0;
		}
		if (pre[i] != pre[i - 1])	flg = 1;
	}
	// cout << cnt << nl;
	return cnt;
}

ll cnt_reverse(string s, ll n)
{
	ll i = 0, ans = 0, flg = 0;
	while (i < n)
	{
		while (i < n && s[i] == '0')
		{
			i++;
			flg = 1;
		}
		if (flg && i < n)
		{
			ans++;
			// i--;
		}
		flg = 0;
		i++;
	}
	// cout << s << " " << ans << nl;
	return ans;
}

void solve()
{
	ll n, x, y;		cin >> n >> x >> y;
	string s;		cin >> s;

	string p;	rloop(i, n - 1, 0)	p += s[i];
	ll ans = min(x * min(cnt_reverse(s, n), cnt_reverse(p, n)) + y, y * cnt_0islands(s, n));
	cout << ans;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}


/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug1(a,n)  loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  3.1415926535; //acos((ld) - 1);

ll cnt_0islands(string s, ll n)
{
	ll cnt = 0, flg = 1;
	loop(i, 0, n)
	{
		if (s[i] == '0' && flg)
		{
			cnt++;
			flg = 0;
		}
		if (s[i] == '1')	flg = 1;
	}
	// cout << cnt << nl;
	return cnt;
}

void solve()
{
	ll n, x, y;		cin >> n >> x >> y;
	string s;		cin >> s;

	ll cnt = cnt_0islands(s, n);
	ll ans = y * cnt;
	ll flg = 1;	if (s[0] == '0' || s[n - 1] == '0')	flg = 0;
	loop(i, 1, cnt)
	{
		ans = min(ans, y * (cnt - i) + x * (i + flg));
	}
	cout << ans;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}


/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug1(a,n)  loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  3.1415926535; //acos((ld) - 1);

ll cnt_0islands(string s, ll n)
{
	ll pre[n + 1];	fill(pre, 0);
	loop(i, 0, n)		if (s[i] == '1')	pre[i + 1]++;
	loop(i, 1, n + 1)	pre[i] += pre[i - 1];
	ll cnt = 0, flg = 1;
	loop(i, 1, n + 1)
	{
		if (pre[i] == pre[i - 1] && flg)
		{
			cnt++;
			flg = 0;
		}
		if (pre[i] != pre[i - 1])	flg = 1;
	}
	// cout << cnt << nl;
	return cnt;
}

void solve()
{
	ll n, x, y;		cin >> n >> x >> y;
	string s;		cin >> s;

	ll cnt = cnt_0islands(s, n);
	ll ans = y * cnt;
	ll flg = 1;	if (s[0] == '0' || s[n - 1] == '0')	flg = 0;
	loop(i, 1, cnt)
	{
		ans = min(ans, y * (cnt - i) + x * (i + flg));
	}
	cout << ans;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}


/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug1(a,n)  loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef deque<ll> dll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  3.1415926535; //acos((ld) - 1);

ll cnt_0islands(string s, ll n)
{
	ll pre[n + 1];	fill(pre, 0);
	loop(i, 0, n)		if (s[i] == '1')	pre[i + 1]++;
	loop(i, 1, n + 1)	pre[i] += pre[i - 1];
	ll cnt = 0, flg = 1;
	loop(i, 1, n + 1)
	{
		if (pre[i] == pre[i - 1] && flg)
		{
			cnt++;
			flg = 0;
		}
		if (pre[i] != pre[i - 1])	flg = 1;
	}
	// cout << cnt << nl;
	return cnt;
}

ll cnt_reverse(string s, ll n)
{
	ll i = 0, ans = 0, flg = 0;
	while (i < n)
	{
		while (i < n && s[i] == '0')
		{
			i++;
			flg = 1;
		}
		if (flg && i < n)
		{
			ans++;
			i--;
		}
		flg = 0;
		i++;
	}
	// cout << s << " " << ans << nl;
	return ans;
}

void solve()
{
	ll n, x, y;		cin >> n >> x >> y;
	string s;		cin >> s;

	string p;	rloop(i, n - 1, 0)	p += s[i];
	ll ans;
	ans = min(x * min(cnt_reverse(s, n), cnt_reverse(p, n)) + y, y * cnt_0islands(s, n));
	ll cnt = count(all(s), '0'), num = 0;
	if (cnt != n)
	{
		if (s[0] == '0' && s[n - 1] == '0')	num = 2;
		else if (s[0] == '0' || s[n - 1] == '0')	num = 1;
		ans = min((x * (min(cnt_reverse(s, n), cnt_reverse(p, n))) - num) + y + num * y, ans);
	}
	cout << ans;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}


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

#define ll long long int
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#define mp make_pair
#define mt make_tuple
#define one(x) memset(x,1,sizeof(x))
#define zero(x) memset(x,0,sizeof(x))
#define ri(x) scanf("%d", &x)
#define rl(x) scanf("%lld", &x)
#define rc(x) scanf("%c", &x)
#define rs(x) scanf("%s", x.c_str())
#define printi(x) printf("%d ", x)
#define printl(x) printf("%lld ", x)
#define prints(x) printf("%s", x)
#define nl printf("\n")
#define VI vector<int>
#define VL vector<ll>
#define VS vector<string>
#define VC vector<char>
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define TI tuple<int, int, int>
#define TL tuple<ll, ll, ll>
#define VPII vector<PII>
#define VPLL vector<PLL>
#define VTI vector<TI>
#define VTL vector<TL>

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
const int N = 3e5 + 3;
char s[N]; int n, x, y;

int _next(int i, char c){
	do{
		++i;
	}
	while(i < n && s[i] == c);
	return i;
}
int main(){
	ri(n); ri(x); ri(y);
	scanf("%s", s);
	int pos = 0;
	string c;
	while(pos < n){
		c += s[pos];
		pos = _next(pos, s[pos]);
	}
	if(n == 300000) cout << c;
	int l = c.length();
	int m = 0;
	for(char ch: c)
		if(ch == '0') m++;

	int one = l - m;
	if(c[0] == '1') --one;
	if(c[l - 1] == '1') --one;
	ll MIN = m * y;
	rep(i, one + 1)
		chmin(MIN , i * x + (m - i) * y);

	printl(MIN);
	return 0;
}


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

#define ll long long int
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#define mp make_pair
#define mt make_tuple
#define one(x) memset(x,1,sizeof(x))
#define zero(x) memset(x,0,sizeof(x))
#define ri(x) scanf("%d", &x)
#define rl(x) scanf("%lld", &x)
#define rc(x) scanf("%c", &x)
#define rs(x) scanf("%s", x.c_str())
#define printi(x) printf("%d ", x)
#define printl(x) printf("%lld ", x)
#define prints(x) printf("%s", x)
#define nl printf("\n")
#define VI vector<int>
#define VL vector<ll>
#define VS vector<string>
#define VC vector<char>
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define TI tuple<int, int, int>
#define TL tuple<ll, ll, ll>
#define VPII vector<PII>
#define VPLL vector<PLL>
#define VTI vector<TI>
#define VTL vector<TL>

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
const int N = 3e5 + 3;
char s[N]; int n, x, y;

int _next(int i, char c){
	do{
		++i;
	}
	while(i < n && s[i] == c);
	return i;
}
int main(){
	ri(n); ri(x); ri(y);
	scanf("%s", s);
	int pos = 0;
	string c;
	while(pos < n){
		c += s[pos];
		pos = _next(pos, s[pos]);
	}
	int l = c.length();
	int m = 0;
	for(char ch: c)
		if(ch == '0') m++;

	int one = l - m;
	if(c[0] == '1') --one;
	if(c[l - 1] == '1') --one;
	ll MIN = m * y;
	rep(i, one + 1)
		chmin(MIN , i * x + (m - i) * y);

	printl(MIN);
	return 0;
}


#include <stdio.h>
int main()
{
	int T; scanf("%d", &T);
	while(T--){
		int n; scanf("%d", &n);
		int a = 0, b = 0, c = 0, d = 0;
		while(n--){
			int x; scanf("%d", &x);
			if(x & 1)
				a++;
			else
				b++;
		}
		int m; scanf("%d", &m);
		while(m--){
			int x; scanf("%d", &x);
			if(x & 1)
				c++;
			else
				d++;
		}
		printf("%d\n", a*c + b*d);
	}
	return 0;
}


#include<iostream>
using namespace std;
int t;
int main() {
	int a, b, n, m, x;
	cin >> t;
	while (t--) {
		a = 0;
		b = 0;
		cin >> n;
		for (int i = 1; i <= n; ++i) {
			cin >> x;
			if (x % 2 == 1)a++;
		}
		cin >> m;
		for (int i = 1; i <= m; ++i) {
			cin >> x;
			if (x % 2 == 1)b++;
		}
		cout << a * b +(n-a)*(m-b)<< endl;
	}
}


#include<iostream>
using namespace std;
int t;
int main() {
	long long a, b, n, m, x;
	cin >> t;
	while (t--) {
		a = 0;
		b = 0;
		cin >> n;
		for (int i = 1; i <= n; ++i) {
			cin >> x;
			if (x % 2 == 1)a++;
		}
		cin >> m;
		for (int i = 1; i <= m; ++i) {
			cin >> x;
			if (x % 2 == 1)b++;
		}
		cout << a * b +(n-a)*(m-b)<< endl;
	}
}


#include<iostream>
using namespace std;
int t;
int main() {
	long long a, b, n, m, x;
	cin >> t;
	while (t--) {
		a = 0;
		b = 0;
		cin >> n;
		for (int i = 1; i <= n; ++i) {
			cin >> x;
			if (x % 2 == 1)a++;
		}
		cin >> m;
		for (int i = 1; i <= m; ++i) {
			cin >> x;
			if (x % 2 == 0)b++;
		}
		cout << a * b +(n-a)*(m-b)<< endl;
	}
}


#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int abs1(int a)
{
        if(a<0)
                a*=-1;
        return a;
}
int main()
{
        int t;
        cin>>t;
        while(t--)
        {
                int n,m;
                cin>>n;
                int num;
                int l1=0,r1=0,l2=0,r2=0;
                for(int i=0;i<n;i++)
                {
                        cin>>num;
                        if(abs1(num)%2==1)
                                l1++;
                        else
                                r1++;
                }
                cin>>m;
                for(int i=0;i<m;i++)
                {
                        cin>>num;
                        if(abs1(num)%2==1)
                                l2++;
                        else
                                r2++;
                }
                cout<<l1*l2+r1*r2<<endl;
        }
        return 0;
}


#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
        int t;
        cin>>t;
        for(int j=0;j<t;j++)
        {
                long long n,m;
                long long num;
                cin>>n;
                long long l1=0,r1=0,l2=0,r2=0;
                for(int i=0;i<n;i++)
                {
                        cin>>num;
                        if(num%2==1)
                                l1++;
                        else
                                r1++;
                }
                cin>>m;
                for(int i=0;i<m;i++)
                {
                        cin>>num;
                        if(num%2==1)
                                l2++;
                        else
                                r2++;
                }
                cout<<l1*l2+r1*r2<<endl;
        }
        return 0;
}


#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
        int t;
        cin>>t;
        for(int j=0;j<t;j++)
        {
                int n,m;
                int num;
                cin>>n;
                int l1=0,r1=0,l2=0,r2=0;
                for(int i=0;i<n;i++)
                {
                        cin>>num;
                        if(num%2==1)
                                l1++;
                        else
                                r1++;
                }
                cin>>m;
                for(int i=0;i<m;i++)
                {
                        cin>>num;
                        if(num%2==1)
                                l2++;
                        else
                                r2++;
                }
                cout<<l1*l2+r1*r2<<endl;
        }
        return 0;
}


#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int abs1(int a)
{
        if(a<0)
                a*=-1;
        return a;
}
int main()
{
        int t;
        cin>>t;
        while(t--)
        {
                int n,m;
                int num1[100005],num2[100005];
                cin>>n;
                for(int i=0;i<n;i++)
                {
                        cin>>num1[i];
                }
                cin>>m;
                for(int i=0;i<m;i++)
                {
                        cin>>num2[i];
                }
                long long ans=0;
                for(int i=0;i<n;i++)
                {
                        for(int j=0;j<m;j++)
                        {
                                if(abs1(num1[i]-num2[j])%2==0)
                                        ans++;
                        }
                }
                cout<<ans<<endl;
        }
        return 0;
}


#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
using namespace std;

int main()
{
  int t;
  cin >> t;
  for (int _ = 0; _ < t; _++)
  {
    int64_t n, chN = 0, nechN = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
      int x;
      cin >> x;
      if (x % 2 == 0)
        chN++;
      else
        nechN++;
    }
    int64_t m, chM = 0, nechM = 0;
    cin >> m;
    for (int i = 0; i < m; i++)
    {
      int x;
      cin >> x;
      if (x % 2 == 0)
        chM++;
      else
        nechM++;
    }

    cout << chM * chN + nechM * nechN;
  }
}


#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
using namespace std;

int main()
{
  int t;
  cin >> t;
  for (int _ = 0; _ < t; _++)
  {
    int64_t n, chN = 0, nechN = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
      int x;
      cin >> x;
      if (x % 2 == 0)
        chN++;
      else
        nechN++;
    }
    int64_t m, chM = 0, nechM = 0;
    cin >> m;
    for (int i = 0; i < m; i++)
    {
      int x;
      cin >> x;
      if (x % 2 == 0)
        chM++;
      else
        nechM++;
    }

    cout << chM * chN + nechM * nechN << '\n';
  }
}


#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
using namespace std;

int main()
{
	long long t, n, m;
	cin >> t;
	for (int i = 0; i < t; i++) {
		cin >> n;
		long long a1=0, a2=0, b1=0, b2=0,a;
		for (int i = 0; i < n; i++) {
			cin >> a;
			if (a % 2 == 0)a2++;
			else a1++;
		}
		cin >> m;
		for (int i = 0; i < m; i++) {
			cin >> a;
			if (a % 2 == 0)b2++;
			else b1++;
		}
		long long nch = 0,ch = 0;
		if (a1 > 0 && b1 > 0) nch = max(a1, b1);
		else nch = 0;
		if (a2 > 0 && b2 > 0) ch = max(a2, b2);
		else ch = 0;
		cout << nch + ch << endl;
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
using namespace std;

int main()
{
	long long t, n, m;
	cin >> t;
	for (int i = 0; i < t; i++) {
		cin >> n;
		long long a1=0, a2=0, b1=0, b2=0,a;
		for (int i = 0; i < n; i++) {
			cin >> a;
			if (abs(a) % 2 == 0)a2++;
			else a1++;
		}
		cin >> m;
		for (int i = 0; i < m; i++) {
			cin >> a;
			if (abs(a) % 2 == 0)b2++;
			else b1++;
		}
		cout << a1 * b1 + a2 * b2<<endl;
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
using namespace std;

int main()
{
	long long t, n, m;
	cin >> t;
	for (int i = 0; i < t; i++) {
		cin >> n;
		long long a1=0, a2=0, b1=0, b2=0,a;
		for (int i = 0; i < n; i++) {
			cin >> a;
			if (abs(a) % 2 == 0)a2++;
			else a1++;
		}
		cin >> m;
		for (int i = 0; i < m; i++) {
			cin >> a;
			if (abs(a) % 2 == 0)b2++;
			else b1++;
		}
		long long nch = 0,ch = 0;
		if (a1 > 0 && b1 > 0) nch = max(a1, b1);
		else nch = 0;
		if (a2 > 0 && b2 > 0) ch = max(a2, b2);
		else ch = 0;
		cout << nch + ch << endl;
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
#include <assert.h>
#include <memory.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

const int N = 100000 + 5;

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int x = 0;
        for (int i = 0; i < n; ++i)
        {
            int v;
            cin >> v;
            x += v % 2;
        }
        int m;
        cin >> m;
        int y = 0;
        for (int i = 0; i < m; ++i)
        {
            int v;
            cin >> v;
            y += v % 2;
        }

        cout << x * y + (n - x) * (m - y) << endl;
    }
}


#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
#include <assert.h>
#include <memory.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

const int N = 100000 + 5;

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        ll n;
        cin >> n;
        ll x = 0;
        for (int i = 0; i < n; ++i)
        {
            int v;
            cin >> v;
            x += v % 2;
        }
        ll m;
        cin >> m;
        ll y = 0;
        for (int i = 0; i < m; ++i)
        {
            int v;
            cin >> v;
            y += v % 2;
        }

        cout << x * y + (n - x) * (m - y) << endl;
    }
}


#include <iostream>
using namespace std;
#define ll long long

int main() {
	ll query;
	cin >> query;
	for (ll i = 0; i < query; i++)
	{
		ll n,m,nOdd=0,mOdd=0;
		cin >> n;
		for (ll j = 0; j < n; j++)
		{
			ll tem;
			cin >> tem;
			if (tem%2)
			{
				nOdd++;
			}
		}
		cin >> m;
		for (ll j = 0; j < m; j++)
		{
			ll tem;
			cin >> tem;
			if (tem%2)
			{
				mOdd++;
			}

		}
		cout << nOdd * mOdd + (n - nOdd) * (m - mOdd)<<endl;

	}

	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int query;
	cin >> query;
	for (int i = 0; i < query; i++)
	{
		int n,m,nOdd=0,mOdd=0;
		cin >> n;
		for (int j = 0; j < n; j++)
		{
			int tem;
			cin >> tem;
			if (tem%2)
			{
				nOdd++;
			}
		}
		cin >> m;
		for (int j = 0; j < m; j++)
		{
			int tem;
			cin >> tem;
			if (tem%2)
			{
				mOdd++;
			}

		}
		cout << nOdd * mOdd + (n - nOdd) * (m - mOdd)<<endl;

	}

	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
int main() {
    long long t;
    cin >> t;
    for (int i = 0; i < t; ++i) {
        long long n, m;
        cin >> n;
        long long ch = 0, nch = 0;
        for (int i = 0; i < n; i++) {
            long long p;
            cin >> p;
            if (p % 2 == 0) {
                ch++;
            }
            else {
                nch++;
            }
        }
        long long ch1 = 0, nch1 = 0;
        cin >> m;
        for (int i = 0; i < m; i++) {
            long long p;
            cin >> p;
            if (p % 2 == 0) {
                ch1++;
            }
            else {
                nch1++;
            }
        }
        cout << ch*ch1 + nch*nch1 << endl;
    }
}


#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
int main() {
    int t;
    cin >> t;
    for (int i = 0; i < t; ++i) {
        int n, m;
        cin >> n;
        int ch = 0, nch = 0;
        for (int i = 0; i < n; i++) {
            int p;
            cin >> p;
            if (p % 2 == 0) {
                ch++;
            }
            else {
                nch++;
            }
        }
        int ch1 = 0, nch1 = 0;
        cin >> m;
        for (int i = 0; i < m; i++) {
            int p;
            cin >> p;
            if (p % 2 == 0) {
                ch1++;
            }
            else {
                nch1++;
            }
        }
        cout << ch*ch1 + nch*nch1 << endl;
    }
}


#include <iomanip>
#include <sstream>
#include <unordered_map>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <stdio.h>
#include <cstdio>
#include <queue>
#include <math.h>
#include <cstdlib>
#include <bitset>
#include <map>
#include <string>
#include <cstring>
using namespace std;
#define forn(i,n)           for(int i=0;i<n;i++)
#define pb(b)               push_back(b)
#define sorted(a)           sort(a.begin(),a.end())
#define reversed(a)         reverse(a.begin(),a.end())
typedef long long ll;
typedef vector<ll> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
int INF = 1e9;
double pi = acos(-1);

// 1 2 3 4 5 6 7 8

int main() {

    int tc;cin>>tc;

    while(tc--){
        vi DLS,JLS;
        ll dlsEVEN=0,dlsODD=0,jlsEVEN=0,jlsODD=0;
        int n,m;
        cin>>n;
        forn(i,n){
            ll nx;cin>>nx;
            if(nx%2==0)dlsEVEN++;
            else dlsODD++;
            DLS.pb(nx);
        }
        cin>>m;

        forn(i,m){
            ll nx;cin>>nx;
            if(nx%2==0)jlsEVEN++;
            else jlsODD++;
            JLS.pb(nx);
        }

        int result=0;
       // result = (jlsODD*dlsODD)+(jlsEVEN*dlsEVEN);
        for(auto x : DLS){
            for(auto y:JLS){
                if(abs(x-y)%2==0)result++;
            }
        }
        cout<<result<<endl;

    }

}

/*

*/


#include <iomanip>
#include <sstream>
#include <unordered_map>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <stdio.h>
#include <cstdio>
#include <queue>
#include <math.h>
#include <cstdlib>
#include <bitset>
#include <map>
#include <string>
#include <cstring>
using namespace std;
#define forn(i,n)           for(int i=0;i<n;i++)
#define pb(b)               push_back(b)
#define sorted(a)           sort(a.begin(),a.end())
#define reversed(a)         reverse(a.begin(),a.end())
typedef long long ll;
typedef vector<ll> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
int INF = 1e9;
double pi = acos(-1);

// 1 2 3 4 5 6 7 8

int main() {

    int tc;cin>>tc;

    while(tc--){

        ll dlsEVEN=0,dlsODD=0,jlsEVEN=0,jlsODD=0;
        int n,m;
        cin>>n;
        forn(i,n){
            ll nx;cin>>nx;
            if(nx%2==0)dlsEVEN++;
            else dlsODD++;
        }
        cin>>m;

        forn(i,m){
            ll nx;cin>>nx;
            if(nx%2==0)jlsEVEN++;
            else jlsODD++;
        }

        int result=0;
        result = (jlsODD*dlsODD)+(jlsEVEN*dlsEVEN);
        cout<<result<<endl;

    }

}

/*

*/


#include <iomanip>
#include <sstream>
#include <unordered_map>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <stdio.h>
#include <cstdio>
#include <queue>
#include <math.h>
#include <cstdlib>
#include <bitset>
#include <map>
#include <string>
#include <cstring>
using namespace std;
#define forn(i,n)           for(int i=0;i<n;i++)
#define pb(b)               push_back(b)
#define sorted(a)           sort(a.begin(),a.end())
#define reversed(a)         reverse(a.begin(),a.end())
typedef long long ll;
typedef vector<ll> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
int INF = 1e9;
double pi = acos(-1);

// 1 2 3 4 5 6 7 8

int main() {

    int tc;cin>>tc;

    while(tc--){

        vi DLS,JLS;
        int dlsEVEN=0,dlsODD=0,jlsEVEN=0,jlsODD=0;
        int n,m;
        cin>>n;
        forn(i,n){
            int nx;cin>>nx;
            if(nx%2==0)dlsEVEN++;
            else dlsODD++;
        }
        cin>>m;

        forn(i,m){
            int nx;cin>>nx;
            if(nx%2==0)jlsEVEN++;
            else jlsODD++;
        }

        int result=0;
        result += (jlsODD*dlsODD);
        result += (jlsEVEN*dlsEVEN);
        cout<<result<<endl;

    }

}


#include <iomanip>
#include <sstream>
#include <unordered_map>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <stdio.h>
#include <cstdio>
#include <queue>
#include <math.h>
#include <cstdlib>
#include <bitset>
#include <map>
#include <string>
#include <cstring>
using namespace std;
#define forn(i,n)           for(int i=0;i<n;i++)
#define pb(b)               push_back(b)
#define sorted(a)           sort(a.begin(),a.end())
#define reversed(a)         reverse(a.begin(),a.end())
typedef long long ll;
typedef vector<ll> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
int INF = 1e9;
double pi = acos(-1);

// 1 2 3 4 5 6 7 8

int main() {

    int tc;cin>>tc;

    while(tc--){
        vi DLS,JLS;
        ll dlsEVEN=0,dlsODD=0,jlsEVEN=0,jlsODD=0;
        int n,m;
        cin>>n;
        forn(i,n){
            ll nx;cin>>nx;
            if(nx%2==0)dlsEVEN++;
            else dlsODD++;
            DLS.pb(nx);
        }
        cin>>m;

        forn(i,m){
            ll nx;cin>>nx;
            if(nx%2==0)jlsEVEN++;
            else jlsODD++;
            JLS.pb(nx);
        }

        ll result=0;
        result = (jlsODD*dlsODD)+(jlsEVEN*dlsEVEN);
        cout<<result<<endl;

    }

}

/*

*/


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

int main(){

    int t;
    cin>>t;

    while(t--){

        int n,m;
        cin>>n;
        long long int e1=0,o1=0,e2=0,o2=0;
        vector<long long int> v(n);
        for(int i=0;i<n;i++){
            cin>>v[i];
            if(v[i]%2==0){
                e1++;
            }
            else{
                o1++;
            }
        }

        cin>>m;

        vector<long long int> a(m);

        for(int i=0;i<m;i++){
            cin>>a[i];
            if(a[i]%2==0){
                e2++;
            }else{
            o2++;
            }
        }

        long long int ans = o1*o2 + e1*e2;

        cout<<ans<<"\n";

    }

    return 0;
}


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

int main(){

    int t;
    cin>>t;

    while(t--){

        int n,m;
        cin>>n;
        int e1=0,o1=0,e2=0,o2=0;
        vector<int> v(n);
        for(int i=0;i<n;i++){
            cin>>v[i];
            if(v[i]%2==0){
                e1++;
            }
            else{
                o1++;
            }
        }

        cin>>m;

        vector<int> a(m);

        for(int i=0;i<m;i++){
            cin>>a[i];
            if(a[i]%2==0){
                e2++;
            }else{
            o2++;
            }
        }

        long long int ans = o1*o2 + e1*e2;

        cout<<ans<<"\n";

    }

    return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int t, n, m;
	int count = 0;
	long long a[100000], b;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		count = 0;
		cin >> n;

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

		cin >> m;

		for (int j = 0; j < m; j++)
		{
			cin >> b;

			for (int k = 0; k < n; k++)
			{
				if (abs(b - a[k]) % 2 == 0)
				{
					count++;
				}
			}
		}

		cout << count << endl;
	}

}


#include <iostream>
using namespace std;

int main()
{
	int t, n,m;
	int count=0;
	long long a[100000], b;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		count = 0;
		cin >> n;

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

		cin >> m;

		for (int j = 0; j < m; j++)
		{
			cin >> b;

			for (int k = 0; k < n; k++)
			{
				if ((b - a[k]) % 2 == 0)
				{
					count++;
				}
			}
		}

		cout << count<<endl;
	}
}


#include <iostream>
using namespace std;

int main()
{
	int t, n, m;
	int count = 0;
	int chet, nech,chet1,nech1,un1,un2;
	long long a, b;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		count = 0;
		cin >> n;
		chet = 0;
		nech = 0;
		chet1 = 0;
		nech1 = 0;
		un1 = 0;
		un2 = 0;

		for (int j = 0; j < n; j++)
		{
			cin >> a;
			if (a==0)
			{
				un1++;
			}
			else if (abs(a) % 2 == 0)
			{
				chet++;
			}
			else
			{
				nech++;
			}
		}

		cin >> m;

		for (int j = 0; j < m; j++)
		{
			cin >> b;

			if (b==0)
			{
				un2++;
			}
			else if (abs(b) % 2 == 0)
			{
				chet1++;
			}
			else
			{
				nech1++;
			}
		}

		count = nech*nech1+chet*chet1;

		if (un1>0)
		{
			count += chet1*un1;
		}

		if (un2 > 0)
		{
			count += chet*un2;
		}

		if ((un1 != 0) && (un2 != 0))
		{
			count+=un1*un2;
		}

		cout << count << endl;
	}

}


#include <iostream>
using namespace std;

int main()
{
	int t, n, m;
	int count = 0;
	int chet, nech,chet1,nech1,un1,un2;
	long long a, b;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		count = 0;
		cin >> n;
		chet = 0;
		nech = 0;
		chet1 = 0;
		nech1 = 0;
		un1 = 0;
		un2 = 0;

		for (int j = 0; j < n; j++)
		{
			cin >> a;
			if (a==0)
			{
				un1=1;
			}
			else if (abs(a) % 2 == 0)
			{
				chet++;
			}
			else
			{
				nech++;
			}
		}

		cin >> m;

		for (int j = 0; j < m; j++)
		{
			cin >> b;

			if (b==0)
			{
				un2=1;
			}
			else if (abs(b) % 2 == 0)
			{
				chet1++;
			}
			else
			{
				nech1++;
			}
		}

		count = nech*nech1+chet*chet1;

		if (un1>0)
		{
			count += chet1;
		}

		if (un2 > 0)
		{
			count += chet;
		}

		if ((un1 != 0) && (un2 != 0))
		{
			count += 1;
		}

		cout << count << endl;
	}

}


#include <iostream>
using namespace std;

int main()
{
	int t, n, m;
	int count = 0;
	int chet, nech,chet1,nech1,un1,un2;
	long long a, b;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		count = 0;
		cin >> n;
		chet = 0;
		nech = 0;
		chet1 = 0;
		nech1 = 0;
		un1 = 0;
		un2 = 0;

		for (int j = 0; j < n; j++)
		{
			cin >> a;
			if (a==0)
			{
				un1++;
			}
			else if (abs(a) % 2 == 0)
			{
				chet++;
			}
			else
			{
				nech++;
			}
		}

		cin >> m;

		for (int j = 0; j < m; j++)
		{
			cin >> b;

			if (b==0)
			{
				un2++;
			}
			else if (abs(b) % 2 == 0)
			{
				chet1++;
			}
			else
			{
				nech1++;
			}
		}

		count = nech*nech1+chet*chet1;

		if (un1>0)
		{
			count += chet1;
		}

		if (un2 > 0)
		{
			count += chet;
		}

		cout << count << endl;
	}

}


#include <iostream>
using namespace std;

int main()
{
	int t, n, m;
	int count = 0;
	int chet, nech,chet1,nech1;
	long long a, b;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		count = 0;
		cin >> n;
		chet = 0;
		nech = 0;
		chet1 = 0;
		nech1 = 0;

		for (int j = 0; j < n; j++)
		{
			cin >> a;
			if (abs(a) % 2 == 0)
			{
				chet++;
			}
			else
			{
				nech++;
			}
		}

		cin >> m;

		for (int j = 0; j < m; j++)
		{
			cin >> b;

			if (abs(b) % 2 == 0)
			{
				chet1++;
			}
			else
			{
				nech1++;
			}
		}

		count = nech*nech1+chet*chet1;

		cout << count << endl;
	}

}


#include <iostream>
using namespace std;

int main()
{
	long long t, n, m;
	long long count = 0;
	long long chet, nech,chet1,nech1,un1,un2;
	long long a, b;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		count = 0;
		cin >> n;
		chet = 0;
		nech = 0;
		chet1 = 0;
		nech1 = 0;
		un1 = 0;
		un2 = 0;

		for (int j = 0; j < n; j++)
		{
			cin >> a;
			if (a==0)
			{
				un1++;
			}
			else if (abs(a) % 2 == 0)
			{
				chet++;
			}
			else
			{
				nech++;
			}
		}

		cin >> m;

		for (int j = 0; j < m; j++)
		{
			cin >> b;

			if (b==0)
			{
				un2++;
			}
			else if (abs(b) % 2 == 0)
			{
				chet1++;
			}
			else
			{
				nech1++;
			}
		}

		count = nech*nech1+chet*chet1;

		if (un1>0)
		{
			count += chet1;
		}

		if (un2 > 0)
		{
			count += chet;
		}

		if ((un1 != 0) && (un2 != 0))
		{
			count++;
		}

		cout << count << endl;
	}

}


#include <iostream>
using namespace std;

int main()
{
	int t, n, m;
	int count = 0;
	int chet, nech,chet1,nech1,un1,un2;
	long long a, b;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		count = 0;
		cin >> n;
		chet = 0;
		nech = 0;
		chet1 = 0;
		nech1 = 0;
		un1 = 0;
		un2 = 0;

		for (int j = 0; j < n; j++)
		{
			cin >> a;
			if (a==0)
			{
				un1=1;
			}
			else if (abs(a) % 2 == 0)
			{
				chet++;
			}
			else
			{
				nech++;
			}
		}

		cin >> m;

		for (int j = 0; j < m; j++)
		{
			cin >> b;

			if (b==0)
			{
				un2=1;
			}
			else if (abs(b) % 2 == 0)
			{
				chet1++;
			}
			else
			{
				nech1++;
			}
		}

		count = nech*nech1+chet*chet1;

		if (un1>0)
		{
			count += chet1;
		}

		if (un2 > 0)
		{
			count += chet;
		}

		if ((un1 != 0) && (un2 != 0))
		{
			count++;
		}

		cout << count << endl;
	}

}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>

using namespace std;

const int maxn = 1e5+5;
int t,n,m;
int a[maxn],b[maxn];

int main()
{
	cin >> t;
	while(t--)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		cin >> n;
		for(int i = 0; i < n; i++)
			cin >> a[i];
		cin >> m;
		for(int i = 0; i < m; i++)
			cin >> b[i];
		int ans = 0;
		for(int i = 0; i < n; i++)
		{
			for(int j = 0; j < m; j++)
			{
				int tmp = abs(a[i] - b[j]);
				if(tmp%2 == 0)
					ans++;
			}
		}
		cout << ans << endl;
	}
 }


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

using namespace std;

typedef long long LL;
int t;
LL n,m,a,b;

int main()
{
	cin >> t;
	while(t--)
	{
		cin >> n;
		LL odd1 = 0,even1 = 0;
		for(int i = 0; i < n; i++)
		{
			cin >> a;
			if(abs(a)%2 == 0)
				odd1++;
			else
				even1++;
		}
		LL odd2 = 0,even2 = 0;
		cin >> m;
		for(int i = 0; i < m; i++)
		{
			cin >> b;
			if(b%2 == 0)
				odd2++;
			else
				even2++;
		}
		LL ans = odd1*odd2 + even1*even2;
		cout << ans << endl;
	}
 }


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

using namespace std;

int t,n,m;
int a,b;

int main()
{
	cin >> t;
	while(t--)
	{
		cin >> n;
		int odd1 = 0,even1 = 0;
		for(int i = 0; i < n; i++)
		{
			cin >> a;
			if(abs(a)%2 == 0)
				odd1++;
			else
				even1++;
		}
		int odd2 = 0,even2 = 0;
		cin >> m;
		for(int i = 0; i < m; i++)
		{
			cin >> b;
			if(b%2 == 0)
				odd2++;
			else
				even2++;
		}
		int ans = odd1*odd2 + even1*even2;

		cout << ans << endl;
	}
 }


#include <iostream>
#include <fstream>
#include <string>
#include <list>
#include <set>
#include <set>
#include <map>
#include <cmath>
#include <vector>
using namespace std;
using u_int = unsigned int;

int main()
{
    u_int q{0};
    //ifstream cin("input.txt");
    cin >> q;

    for (u_int i = 0; i < q; i++) {

        u_int n{0};
        cin >> n;
        u_int p_c{0};
        u_int p_n{0};

        for (u_int j = 0; j < n; j++){
            int tmp;
            cin >> tmp;
            if( tmp % 2 == 0)
                p_c++;
            else
                p_n++;
        }

        u_int m{0};
        cin >> m;
        u_int q_c{0};
        u_int q_n{0};

        for (u_int j = 0; j < m; j++){
            int tmp;
            cin >> tmp;
            if( tmp % 2 == 0)
                q_c++;
            else
                q_n++;
        }

        long long result = p_c*q_c;
        result += p_n*q_n;

        cout << result << endl;

    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <list>
#include <set>
#include <set>
#include <map>
#include <cmath>
#include <vector>
using namespace std;
using u_int = unsigned int;

int main()
{
    u_int q{0};
  //  ifstream cin("input.txt");
    cin >> q;

    for (u_int i = 0; i < q; i++) {

        u_int n{0};
        cin >> n;
        int p_c{0};
        int p_n{0};

        for (u_int j = 0; j < n; j++){
            int tmp;
            cin >> tmp;
            if( tmp % 2 == 0)
                p_c++;
            else
                p_n++;
        }

        u_int m{0};
        cin >> m;
        int q_c{0};
        int q_n{0};

        for (u_int j = 0; j < m; j++){
            int tmp;
            cin >> tmp;
            if( tmp % 2 == 0)
                q_c++;
            else
                q_n++;
        }

        long long result = p_c*q_c + p_n*q_n;

        cout << result << endl;

    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <list>
#include <set>
#include <set>
#include <map>
#include <cmath>
#include <vector>
using namespace std;
using u_int = unsigned int;

int main()
{
    u_int q{0};
   // ifstream cin("input.txt");
    cin >> q;

    for (u_int i = 0; i < q; i++) {

        u_int n{0};
        cin >> n;
        vector<int>p(n);

        for (u_int j = 0; j < n; j++)
            cin >> p[j];

        u_int m{0};
        cin >> m;
        vector<int>qi(m);

        for (u_int j = 0; j < m; j++)
            cin >> qi[j];

        u_int result{0};
        for (auto &ch : qi) {
            for (auto &ch1 : p){
                if ( abs(ch-ch1) % 2 == 0)
                    result++;
            }
        }
        cout << result << endl;

    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <list>
#include <set>
#include <set>
#include <map>
#include <cmath>
#include <vector>
using namespace std;
using u_int = unsigned int;

int main()
{
    u_int q{0};
    //ifstream cin("input.txt");
    cin >> q;
    for (u_int i = 0; i < q; i++) {

        u_int n{0};
        cin >> n;
        long long p_c{0};
        long long p_n{0};

        for (u_int j = 0; j < n; j++){
            int tmp;
            cin >> tmp;
            if( tmp % 2 == 0)
                p_c++;
            else
                p_n++;
        }

        u_int m{0};
        cin >> m;
        long long q_c{0};
        long long q_n{0};

        for (u_int j = 0; j < m; j++){
            int tmp;
            cin >> tmp;
            if( tmp % 2 == 0)
                q_c++;
            else
                q_n++;
        }

        long long result = p_c*q_c;
        result += p_n*q_n;

        cout << result << endl;

    }
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <cinttypes>

using namespace std;

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int t;
    scanf("%d", &t);
    for (int i = 0; i < t; ++i) {
        int n;
        scanf("%d", &n);

        long long even1 = 0;
        long long odd1 = 0;
        for (int j = 0; j < n; ++j)
        {
            int num;
            scanf("%d", &num);

            if (num % 2 == 0)
            {
                even1++;
            }
            else
            {
                odd1++;
            }
        }

        int m;
        scanf("%d", &m);

        long long even2 = 0;
        long long odd2 = 0;
        for (int j = 0; j < m; ++j)
        {
            int num;
            scanf("%d", &num);

            if (num % 2 == 0)
            {
                even2++;
            }
            else
            {
                odd2++;
            }
        }

        printf("%" PRId64  "\n", even1 * even2 + odd1 * odd2);
    }
}


#include <cstdio>
#include <algorithm>

using namespace std;

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int t;
    scanf("%d", &t);
    for (int i = 0; i < t; ++i) {
        int n;
        scanf("%d", &n);

        int even1 = 0;
        int odd1 = 0;
        for (int j = 0; j < n; ++j)
        {
            int num;
            scanf("%d", &num);

            if (num % 2 == 0)
            {
                even1++;
            }
            else
            {
                odd1++;
            }
        }

        int m;
        scanf("%d", &m);

        int even2 = 0;
        int odd2 = 0;
        for (int j = 0; j < m; ++j)
        {
            int num;
            scanf("%d", &num);

            if (num % 2 == 0)
            {
                even2++;
            }
            else
            {
                odd2++;
            }
        }

        printf("%d\n", even1 * even2 + odd1 * odd2);
    }
}


// Problem 1248A Integer points.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

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

int main()
{
    int cases, n = 0, m = 0, temp = 0,count=0;
    cin >> cases;
    vector<int> linesN;
    vector<int> linesM;
    int i = 1;
    while (i <= cases) {
        count = 0;
        linesN.clear();
        linesM.clear();
        cin >> n;
        for (int x = 1;x <= n;x++) {
            cin >> temp;
            linesN.push_back(temp);
        }
        cin >> m;
        for (int x = 1;x <= m;x++) {
            cin >> temp;
            linesM.push_back(temp);
        }

        for (int x = 1;x <= n;x++) {
            for (int y = 1;y <= m;y++) {
                if ((linesN[x-1] + linesM[y-1]) % 2 == 0) {
                    count++;
                }
            }
        }
        cout << count << endl;
        i++;
    }
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started:
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file


// Problem 1248A Integer points.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

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

int main()
{
    int cases, n = 0, m = 0, temp = 0,countN=0,countM=0;
    cin >> cases;
    vector<int> linesN;
    vector<int> linesM;
    int i = 1;
    while (i <= cases) {
        countN = 0;
        countM = 0;
        //linesN.clear();
        //linesM.clear();
        cin >> n;
        for (int x = 1;x <= n;x++) {
            cin>>temp;
            if (temp % 2 == 0) {
                countN++;
            }
        }
        cin >> m;
        for (int x = 1;x <= m;x++) {
            cin >> temp;
            if (temp % 2 == 0) {
                countM++;
            }
        }

        cout << (countN*countM)+(n-countN)*(m-countM) << endl;
        i++;
    }
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started:
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file


// Problem 1248A Integer points.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

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

int main()
{
    int cases, n = 0, m = 0, temp = 0,countN=0,countM=0;
    cin >> cases;
    vector<int> linesN;
    vector<int> linesM;
    int i = 1;
    while (i <= cases) {
        countN = 0;
        countM = 0;
        //linesN.clear();
        //linesM.clear();
        cin >> n;
        for (int x = 1;x <= n;x++) {
            cin>>temp;
            if (temp % 2 == 0) {
                countN++;
            }
        }
        cin >> m;
        for (int x = 1;x <= m;x++) {
            cin >> temp;
            if (temp % 2 == 0) {
                countM++;
            }
        }

        cout << (countN+countM)/2+(n-countN)*(m-countM) << endl;
        i++;
    }
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started:
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file


// Problem 1248A Integer points.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
using namespace std;

int main()
{
    long long int cases, n = 0, m = 0, temp = 0,countN=0,countM=0;
    cin >> cases;

    int i = 1;
    while (i <= cases) {
        countN = 0;
        countM = 0;
        cin >> n;
        for (int x = 1;x <= n;x++) {
            cin>>temp;
            if (temp % 2 == 0) {
                countN++;
            }
        }
        cin >> m;
        for (int x = 1;x <= m;x++) {
            cin >> temp;
            if (temp % 2 == 0) {
                countM++;
            }
        }

        cout << (countN*countM)+(n-countN)*(m-countM) << endl;
        i++;
    }
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started:
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file


#include <iostream>
#include <vector>

using namespace std;

int main() {
	int t;

	cin >> t;
	while (t--)
	{
		int mx = 0, x = 0, mxn = 0, xn = 0;
		int n;
		cin >> n;
		for (size_t i = 0; i < n; i++)
		{
			int temp;
			scanf_s(" %d", &temp);
			if (temp % 2 == 0) { x++; }
			else
			{
				xn++;
			}
		}
		cin >> n;
		for (size_t i = 0; i < n; i++)
		{
			int temp;
			scanf_s(" %d", &temp);
			if (temp % 2 == 0) { mx++; }
			else
			{
				mxn++;
			}
		}
		printf("%d\n", mx*x + mxn*xn);
	}
	//system("pause");
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
	long long t;
	long long n;
	long long temp;
	long long mx = 0, x = 0, mxn = 0, xn = 0;
	cin >> t;
	while (t--)
	{
		mx = 0; x = 0; mxn = 0; xn = 0;

		cin >> n;
		for (size_t i = 0; i < n; i++)
		{

			cin >> temp;
			if (temp % 2 == 0) { x++; }
			else
			{
				xn++;
			}
		}
		cin >> n;
		for (size_t i = 0; i < n; i++)
		{
			cin >> temp;
			if (temp % 2 == 0) { mx++; }
			else
			{
				mxn++;
			}

		}
		//prlong longf("%d\n", mx*x + mxn*xn);
		cout << mx*x + mxn*xn << endl;
	}
	//system("pause");
}


#include <cstdio>
#include <algorithm>
int const maxn = 1e5+2;
using namespace std;
int bl[maxn];
int main(){
	int t, i, j;
	int n, m;
	int a, b, c, d;
	scanf("%d", &t);
	while(t--){
		a = b= c= d = 0;
		scanf("%d", &n);
		for(i = 0; i < n; i++){
			scanf("%d", bl+i);
			if(bl[i]%2 == 0)
				a++;
			else
				b++;
		}
		scanf("%d", &m);
		for(i = 0; i < m; i++){
			scanf("%d", bl+i);
			if(bl[i]%2== 0)
				d++;
			else
				c++;
		}
		printf("%d\n", a*d+b*c);
	}

	return 0;
}


#include <cstdio>
#include <algorithm>
int const maxn = 1e5+2;
using namespace std;
int bl[maxn];
int main(){
	int t, i, j;
	int n, m;
	long long  a, b, c, d;
	scanf("%d", &t);
	while(t--){
		a = b= c= d = 0;
		scanf("%d", &n);
		for(i = 0; i < n; i++){
			scanf("%d", bl+i);
			if(bl[i]%2 == 0)
				a++;
			else
				b++;
		}
		scanf("%d", &m);
		for(i = 0; i < m; i++){
			scanf("%d", bl+i);
			if(bl[i]%2== 0)
				d++;
			else
				c++;
		}
		printf("%lld\n", (a*d+b*c));
	}

	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
int main()
{
	int t,n,m,a[100005],b[100005];
	scanf("%d",&t);
	ll sum1,sum2,sum3,sum4;
	for(int i=1;i<=t;i++)
	{

		sum1=0;
		sum2=0;
		sum3=0;
		sum4=0;
		scanf("%d",&n);
		for(int j=0;j<n;j++)
		{
			scanf("%d",&a[j]);
			if(a[j]%2==0)
			{
				sum1++;
			}
			else
			{
				sum2++;
			}
		}
		scanf("%d",&m);
		for(int j=0;j<m;j++)
		{
			scanf("%d",&b[j]);
			if(b[j]%2==0)
			{
				sum3++;
			}
			else
			{
				sum4++;
			}
		}
		printf("%lld\n",sum1*sum3+sum2*sum4);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
	int t,n,m,a[100005],b[100005];
	scanf("%d",&t);
	int sum,sum1,sum2,sum3,sum4;
	for(int i=1;i<=t;i++)
	{

		sum1=0;
		sum2=0;
		sum3=0;
		sum4=0;
		scanf("%d",&n);
		for(int j=0;j<n;j++)
		{
			scanf("%d",&a[j]);
			if(a[j]%2==0)
			{
				sum1++;
			}
			else
			{
				sum2++;
			}
		}
		scanf("%d",&m);
		for(int j=0;j<m;j++)
		{
			scanf("%d",&b[j]);
			if(b[j]%2==0)
			{
				sum3++;
			}
			else
			{
				sum4++;
			}
		}
		printf("%d\n",sum1*sum3+sum2*sum4);
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <conio.h>
#include <ctime>
#include <cmath>
#include <cstdlib>
#include <cstdio>

typedef long long ll;

using namespace std;

int main()
{
	int t;
	cin >> t;
	for (int k = 0; k<t; k++)
	{
		int c_1 = 0, c_2 = 0, nc_1 = 0, nc_2 = 0;
		int n;
		cin >> n;
		int *arr = new int[n];
		for (int i = 0; i < n; i++)
		{
			cin >> arr[i];
			if (arr[i] % 2)
			{
				c_1++;
			}
			else
			{
				nc_1++;
			}
		}
		int m;
		cin >> m;
		int *arr_2 = new int[m];
		for (int i = 0; i < m; i++)
		{
			cin >> arr[i];
			if (arr[i] % 2)
			{
				c_2++;
			}
			else
			{
				nc_2++;
			}
		}
		int result = c_1 * c_2 + nc_1 * nc_2;
		cout << result << endl;

		delete[] arr;
		delete[] arr_2;
	}

	return 0;
}


#include <iostream>
#include <cstring>
#include <conio.h>
#include <ctime>
#include <cmath>
#include <cstdlib>
#include <cstdio>

typedef long long ll;

using namespace std;

int main()
{
	int t;
	cin >> t;
	for (int k = 0; k<t; k++)
	{
		int c_1 = 0, c_2 = 0, nc_1 = 0, nc_2 = 0;
		int n;
		cin >> n;
		int *arr = new int[n];
		for (int i = 0; i < n; i++)
		{
			cin >> arr[i];
			if (arr[i] % 2)
			{
				c_1++;
			}
			else
			{
				nc_1++;
			}
		}
		int m;
		cin >> m;
		int *arr_2 = new int[m];
		for (int i = 0; i < m; i++)
		{
			cin >> arr[i];
			if (arr[i] % 2)
			{
				c_2++;
			}
			else
			{
				nc_2++;
			}
		}
		int result = c_1 * c_2 + nc_1 * nc_2;
		cout << result << endl;

	}

	return 0;
}


#include <iostream>
#include <cstring>
#include <conio.h>
#include <ctime>
#include <cmath>
#include <cstdlib>
#include <cstdio>

typedef long long ll;

using namespace std;

int main()
{
	int t;
	cin >> t;
	for (int k = 0; k<t; k++)
	{
		int c_1 = 0, c_2 = 0, nc_1 = 0, nc_2 = 0;
		int n;
		cin >> n;
		int *arr = new int[n];
		for (int i = 0; i < n; i++)
		{
			cin >> arr[i];
			if (arr[i] % 2)
			{
				c_1++;
			}
			else
			{
				nc_1++;
			}
		}
		int m;
		cin >> m;
		int *arr_2 = new int[m];
		for (int i = 0; i < m; i++)
		{
			cin >> arr_2[i];
			if (arr_2[i] % 2)
			{
				c_2++;
			}
			else
			{
				nc_2++;
			}
		}
		int result = c_1 * c_2 + nc_1 * nc_2;
		cout << result << endl;

		delete[] arr;
		delete[] arr_2;
	}

	return 0;
}


#include <iostream>
#include <cstring>
#include <conio.h>
#include <ctime>
#include <cmath>
#include <cstdlib>
#include <cstdio>

typedef long long ll;

using namespace std;

int main()
{
	int t;
	cin >> t;
	for (int k = 0; k<t; k++)
	{
		ll c_1 = 0, c_2 = 0, nc_1 = 0, nc_2 = 0;
		ll n;
		cin >> n;
		ll *arr = new ll[n];
		for (int i = 0; i < n; i++)
		{
			cin >> arr[i];
			if (arr[i] % 2)
			{
				c_1++;
			}
			else
			{
				nc_1++;
			}
		}
		ll m;
		cin >> m;
		ll *arr_2 = new ll[m];
		for (int i = 0; i < m; i++)
		{
			cin >> arr_2[i];
			if (arr_2[i] % 2)
			{
				c_2++;
			}
			else
			{
				nc_2++;
			}
		}
		ll result = c_1 * c_2 + nc_1 * nc_2;
		cout << result << endl;

		delete[] arr;
		delete[] arr_2;
	}

	return 0;
}