n,r=input().split()
l=input().split()
l=list(map(int,l))
s=input()

r=int(r)
q=[]

m=s[0]
f=0
q=[l[0]]
for i in range(1,len(s)):
    if s[i]==m:
        q.append(l[i])
    else:
        m=s[i]
        q.sort(reverse=True)
        f=f+sum(q[:r])
        q=[]
        q.append(l[i])
q.sort(reverse=True)
f=f+sum(q[:r])
print(f)


t = list(map(int, input().split(" ")))
n = t[0]
k = t[1]
a = list(map(int, input().split(" ")))
s = list(input())
c = 0
t = []
t.append(a[0])
for i in range(1, n):
    if s[i]==s[i-1]:
        if i==n-1:
            t.append(a[i])
            t.sort(reverse = True)
            t = t[:k]
            q = sum(t)
            c = c + q
        else:
            t.append(a[i])
    else:
        if i==n-1:
            t.sort(reverse = True)
            t = t[:k]
            q = sum(t) + a[i]
            c = c + q
            t = []
        else:
            t.sort(reverse = True)
            t = t[:k]
            q = sum(t)
            c = c + q
            t = []
            t.append(a[i])
print(c)


q = list(map(int, input().split(" ")))
n = q[0]
k = q[1]
a = list(map(int, input().split(" ")))
s = input()
s = list(s)
l = 0
tot = sum(a)
t = 0
count = 1
if n==1:
    print(tot)
    exit()
d = []
d.append(a[0])
for i in range(1, n):
    if s[i]==s[i-1]:
        count = count + 1
        d.append(a[i])
    else:
        count = 1
        l = 0
        d = []
        d.append(a[i])
    m = 0
    if count>k:
        d.sort()
        d = d[:count-k]
        m = sum(d)
    tot = tot - m
print(tot)


q = list(map(int, input().split(" ")))
n = q[0]
k = q[1]
a = list(map(int, input().split(" ")))
s = input()
s = list(s)
l = 0
tot = sum(a)
t = 0
count = 1
if n==1:
    print(tot)
    exit()
d = []
d.append(a[0])
for i in range(1, n):
    if s[i]==s[i-1]:
        count = count + 1
        d.append(a[i])
    else:
        count = 1
        d = []
        d.append(a[i])
    m = 0
if count>k:
    d.sort()
    d = d[:count-k]
    m = sum(d)
tot = tot - m
print(tot)


t = list(map(int, input().split(" ")))
n = t[0]
k = t[1]
a = list(map(int, input().split(" ")))
s = list(input())
c = 0
if n==1:
    c = a[0]
t = []
t.append(a[0])
for i in range(1, n):
    if s[i]==s[i-1]:
        if i==n-1:
            t.append(a[i])
            t.sort(reverse = True)
            t = t[:k]
            q = sum(t)
            c = c + q
        else:
            t.append(a[i])
    else:
        if i==n-1:
            t.sort(reverse = True)
            t = t[:k]
            q = sum(t) + a[i]
            c = c + q
            t = []
        else:
            t.sort(reverse = True)
            t = t[:k]
            q = sum(t)
            c = c + q
            t = []
            t.append(a[i])
print(c)


import sys

if __name__ == "__main__":
    [n1, k1] = sys.stdin.readline().split(' ')
    n = int(n1)
    k = int(k1)
    v = list(map(lambda x: int(x), sys.stdin.readline().split(' ')))
    s = sys.stdin.readline()
    v = list(zip(v, range(0, len(v)), s))

    current_char = s[0]
    sequence_start = 0
    total_dmg = 0
    for i in range(0, len(s)):
        if s[i] != current_char:
            substring = v[sequence_start:i]
            sorted_substring = list(sorted(substring, key=lambda x: x[0], reverse=True))
            if len(sorted_substring) > k:
                sorted_substring = sorted_substring[0:k]
            for x in sorted_substring:
                total_dmg += x[0]

            current_char = s[i]
            sequence_start = i

    print(total_dmg)


n, k = map(int, input().strip().split())
shots = list(map(int, input().strip().split()))
s = list(input().strip())

def choose(l, r):
    if r - l <= k + 1:
        return min(shots[l:r])
    if r - l > k * 2:
        return choose(l, ((r+l)//2)) + choose((r+l)//2, r)
    return min(choose(l, r - k) + choose(l + k, r), choose(r - n, l + k))

summa = sum(shots)
current_i = ""
current_num = 0
for i in range(n):
    if s[i] == current_i:
        current_num += 1
    else:
        if current_num > k:
            summa -= choose(i - current_num, i)
        current_i = s[i]
        current_num = 1

if current_num > k:
   summa -= choose(n - current_num, n)
print(summa)


n, k = map(int, input().strip().split())
shots = list(map(int, input().strip().split()))
s = list(input().strip())

def choose(l, r):
    tmp = sorted(shots[l:r])
    return sum(tmp[0:r-l-k])

summa = sum(shots)
current_i = ""
current_num = 0
for i in range(n):
    if s[i] == current_i:
        current_num += 1
    else:
        if current_num > k:
            summa -= choose(i - current_num, i)
        current_i = s[i]
        current_num = 1

if current_num > k:
   summa -= choose(n - current_num, n)
print(summa)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=input()
i=0
ans=0
while(i<n):
    c=0
    for j in range(i,n):
        if(s[i]==s[j]):
            c+=1
    x=a[i:i+c]
    x.sort(reverse=True)
    #print(x)
    x=x[0:k]
    #print(x)
    ans+=sum(x)
    #print(a[i])
    if(c==0):
        ans+=a[i]
    i+=c
    if(c==0):
        i+=1
print(ans)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=input()
i=0
ans=0
while(i<n):
    c=0
    for j in range(i,n):
        if(s[i]==s[j]):
            c+=1
        else:
            break
    #print(c)
    x=a[i:i+c]
    x.sort(reverse=True)
    #print(x)
    x=x[0:k]
    #print(x)
    ans+=sum(x)
    #print(a[i])
    if(c==0):
        ans+=a[i]
    i+=c
print(ans)


import heapq

n, k = map(int, input().split(' '))
a = [int(x) for x in input().split(' ')]
m = list(input())

heap = []
p = -1
s = 0
for i in range(n):
    if p == m[i]:
        heapq.heappush(heap, (m[i], a[i]))
        if len(heap) > k: s -= heapq.heappop(heap)[1]
    else:
        heap.clear()
        heapq.heappush(heap, (m[i], a[i]))
    s += a[i]
    p = m[i]
    #print(s, heap)
print(s)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=input()
i=0
tot=0
while i<n:
    count=0
    ch=s[i]
    arr=[]
    while i<n and s[i]==ch:
        arr.append(a[i])
        count+=1
        i+=1
    if count<=k:
        tot+=sum(arr)
    else:
        arr.sort()
        tot+=sum(arr[count-k:count])
print(tot)


n, maxhits = map(int, input().split())
ls,line = list(map(int, input().split())), list(input())
currbutt,moves,dmg = "a",[],0
for i, button in enumerate(line):
	if button == currbutt: moves.append(ls[i])
	else:
		if len(moves) > maxhits:
			moves.sort(reverse=True)
			moves = moves[:maxhits]
		dmg+= sum(moves)
		currbutt,moves = button, [ls[i]]
if len(moves) > maxhits:
	moves.sort(reverse=True)
	moves = moves[:maxhits]
print(dmg+sum(moves))


from sys import stdin,stdout
from collections import defaultdict,Counter
import math
#stdin = open('input.txt','r')

I = stdin.readline
P = stdout.write

n,k = map(int,I().split())
arr = [int(x) for x in I().split()]

s = I().rstrip()
dmg = 0
i = 0
if(n == 1):
	print(arr[0])
else:

	while(i<n):
		if(i<n-1):
			if(s[i]!=s[i+1]):
				dmg+=arr[i]
			else:
				for j in range(i+1,n):
					if(s[j]!=s[j-1]):
						print
						break
				j-=1
				if(j == n-2 and s[-1] == s[-2]): j+=1

				cou = j-i+1
				new = arr[i:j+1]
				#print(cou,j,i)
				if(cou<=k):
					dmg+=sum(new)
				else:
					new.sort(reverse = True)
					dmg+=sum(new[0:k])
					#print(new[0:k])
				i = j
		i+=1
		if(i == n and s[-1]!=s[-2]):
			dmg+=arr[-1]
	print(dmg)


from sys import stdin,stdout
from collections import defaultdict,Counter
import math
#stdin = open('input.txt','r')

I = stdin.readline
P = stdout.write

n,k = map(int,I().split())
arr = [int(x) for x in I().split()]

s = I().rstrip()
dmg = 0
i = 0
while(i<n):
	if(i<n-1):
		if(s[i]!=s[i+1]):
			dmg+=arr[i]
		else:
			for j in range(i+1,n):
				if(s[j]!=s[j-1]):
					print
					break
			j-=1
			if(j == n-2 and s[-1] == s[-2]): j+=1

			cou = j-i+1
			new = arr[i:j+1]
			#print(cou,j,i)
			if(cou<=k):
				dmg+=sum(new)
			else:
				new.sort(reverse = True)
				dmg+=sum(new[0:k])
				#print(new[0:k])
			i = j
	i+=1
	if(i == n and s[-1]!=s[-2]):
		dmg+=arr[-1]
print(dmg)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=input()
i,j,dmg=0,1,0
while j<n:
	if(s[j]==s[i]):
		j+=1
	else:
		dmg+=sum(sorted(a[i:j])[-k:])
		i,j=j,j+1
dmg+=sum(sorted(a[i:])[-k:])
print(dmg)


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod=1e9+7;
const int N=2e5+5;
const int MAX=0x7fffffff;
const int MIN=0x80000000;
int n,k;
struct node{
    int num,index;
    bool friend operator<(node a,node b){return a.num>b.num;}
};
node a[N];
char ch[N];
int pos[N]={0};
int dp[N]={0};
int main(){
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i].num);
        a[i].index=i;
    }
    scanf("%s",ch);
    ll sum=0;
    sort(a,a+n);
    pos[0]=0;
    for(int i=1;i<n;i++){
        if(ch[i]==ch[i-1])
            pos[i]=pos[i-1];
        else
            pos[i]=i;
    }
    for(int i=0;i<n;i++){
        if(dp[pos[a[i].index]]<k){
            sum+=a[i].num;
            dp[pos[a[i].index]]++;
        }
    }
    cout<<sum<<endl;
}


n, k = map(int, input().split())
a = list(map(int, input().split()))
s = input()
t = [[0]]
for i in range(1, n):
    if s[i] == s[i-1]: t[-1].append(i)
    else: t.append([i])
ans = 0
for seg in t:
    seg.sort(key = lambda x: a[x], reverse = True)
    for i in range(min(k, len(seg))):
        ans += a[seg[i]]
print(ans)


from itertools import combinations
from sys import stdin,stdout

def listIn():
    return list((map(int,stdin.readline().strip().split())))

def stringListIn():
    return([x for x in stdin.readline().split()])

def intIn():
    return (int(stdin.readline()))

def stringIn():
    return (stdin.readline())

if __name__=="__main__":
    n,k=listIn()
    a=listIn()
    s=stringIn()
    ans=[0]*n
    cnt=1
    for i in range(1,n):
        if s[i]==s[i-1]:
            cnt+=1
        else:
            ans[i-cnt]=cnt
            cnt=1

        if i==n-1:
            if cnt!=1:
                ans[i-cnt+1]=cnt
            else:
                ans[i]=cnt
    #print(ans)
    total=0
    i=0
    while i<n:
        if ans[i]>k:
            m=a[i:i+ans[i]]
            m=sorted(m)
            total+=sum(m[ans[i]-k:])
        else:
            m=a[i:i+ans[i]]
            m=sorted(m)
            total+=sum(m)
        #print(m,total,ans[i])
        i=i+ans[i]

    print(total)


from itertools import combinations
from sys import stdin,stdout

def listIn():
    return list((map(int,stdin.readline().strip().split())))

def stringListIn():
    return([x for x in stdin.readline().split()])

def intIn():
    return (int(stdin.readline()))

def stringIn():
    return (stdin.readline())

if __name__=="__main__":
    n,k=listIn()
    a=listIn()
    s=stringIn()
    if n==1:
        print(a[0])
        exit(0)
    ans=[0]*n
    cnt=1
    for i in range(1,n):
        if s[i]==s[i-1]:
            cnt+=1
        else:
            ans[i-cnt]=cnt
            cnt=1

        if i==n-1:
            if cnt!=1:
                ans[i-cnt+1]=cnt
            else:
                ans[i]=cnt
    #print(ans)
    total=0
    i=0
    while i<n:
        if ans[i]>k:
            m=a[i:i+ans[i]]
            m=sorted(m)[::-1]
            total+=sum(m[:k])
        else:
            m=a[i:i+ans[i]]
            m=sorted(m)
            total+=sum(m)
        #print(m,total,ans[i])
        i=i+ans[i]

    print(total)


def brutal(n1,n2,m,comb):
    m=[int(m[i]) for i in range(len(m))]
    if n2>n1:
        return "Incorrect input"
    comb=[comb[i] for i in range(len(comb))]
    count=[]
    new=comb[0]
    result=0
    for i in range(len(comb)):
        if comb[i]!=new:
            result+=sum(count)
            #print(result)
            new=comb[i]
            count=[]
        if comb[i]==new:
            if len(count)==n2:
                cont=list(enumerate(count))
                if m[i]>min(cont,key = lambda item:item[1])[1]:
                    count[min(cont,key = lambda item:item[1])[0]]=m[i]
            else:
                count.append(m[i])
    result+=sum(count)
    return result

n=input().strip().split()
print(brutal(int(n[0]),int(n[1]),input().strip().split(),input().strip()))


def brutal(n1,n2,m,comb):
    m=[int(m[i]) for i in range(len(m))]
    if n2>n1:
        return "Incorrect input"
    comb=[comb[i] for i in range(len(comb))]
    count=[]
    new=comb[0]
    result=0
    for i in range(len(comb)):
        if comb[i]!=new:
            result+=sum(count)
            print(result)
            new=comb[i]
            count=[]
        if comb[i]==new:
            if len(count)==n2:
                cont=list(enumerate(count))
                if m[i]>min(cont,key = lambda item:item[1])[1]:
                    count[min(cont,key = lambda item:item[1])[0]]=m[i]
            else:
                count.append(m[i])
    result+=sum(count)
    return result

n=input().strip().split()
print(brutal(int(n[0]),int(n[1]),input().strip().split(),input().strip()))


def brutal(n1,n2,m,comb):
    m=[int(m[i]) for i in range(len(m))]
    if n2>n1:
        return "Incorrect input"
    count=[]
    new=comb[0]
    result=0
    for i in range(len(comb)):
        if comb[i]!=new:
            if len(count)<=n2:
                result+= sum(count)
            else:
                count.sort()
                for j in range(len(count)-1,len(count)-n2-1,-1):
                    result+=count[j]
            new=comb[i]
            count=[]
        if comb[i]==new:
            count.append(m[i])

    if len(count) <= n2:
        result += sum(count)
    else:
        count.sort()
        for j in range(len(count) - 1, len(count) - n2 - 1, -1):
            result += count[j]
    return result

n=input().strip().split()
print(brutal(int(n[0]),int(n[1]),input().strip().split(),input().strip()))


def brutal(n1,n2,m,comb):
    m=[int(m[i]) for i in range(len(m))]
    if n2>n1:
        return "Incorrect input"
    count=[]
    new=comb[0]
    result=0
    for i in range(len(comb)):
        if comb[i]!=new:
            if len(count)<=n2:
                result+= sum(count)
            else:
                count.sort()
                for j in range(len(count)-1,len(count)-n2-1,-1):
                    result+=count[j]
            new=comb[i]
            count=[]
        if comb[i]==new:
            count.append(m[i])
    result+=sum(count)
    return result

n=input().strip().split()
print(brutal(int(n[0]),int(n[1]),input().strip().split(),input().strip()))


def brutal(n1,n2,m,comb):
    m=[int(m[i]) for i in range(len(m))]
    if n2>n1:
        return "Incorrect input"
    count=[]
    new=comb[0]
    result=0
    for i in range(len(comb)):
        if comb[i]!=new:
            if len(count)<=n2:
                result+= sum(count)
            else:
                count.sort()
                for j in range(len(count)-1,len(count)-n2-1,-1):
                    result+=count[j]
            new=comb[i]
            count=[]
        if comb[i]==new:
            count.append(m[i])
    count.sort()
    for j in range(len(count) - 1, len(count) - n2 - 1, -1):
        result += count[j]
    return result

n=input().strip().split()
print(brutal(int(n[0]),int(n[1]),input().strip().split(),input().strip()))


from itertools import groupby

n, k = map(int, input().split())
arr = list(map(int, input().split()))
st = input()
pos = 0
l = 0
ans = 0
for a, b in groupby(st):
    l += len(list(b))
    brr = arr[pos:l]
    brr.sort(reverse=True)
    pos = l
    try:
##        print(brr[0:k])
        ans += sum(brr[0:k])
    except:
##        print(brr, "asdf")
        ans += sum(brr)
print(ans)


import os
import sys
from io import BytesIO, IOBase
import math

def main():
    pass

BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

def binary(n):
    return (bin(n).replace("0b", ""))

def decimal(s):
    return (int(s, 2))

def pow2(n):
    p = 0
    while (n > 1):
        n //= 2
        p += 1
    return (p)

def primeFactors(n):
    l=[]
    while n % 2 == 0:
        l.append(2)
        n = n / 2
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        while n % i == 0:
            l.append(i)
            n = n / i
    if n > 2:
        l.append(int(n))
    return (l)

def isPrime(n):
    if (n == 1):
        return (False)
    else:
        root = int(n ** 0.5)
        root += 1
        for i in range(2, root):
            if (n % i == 0):
                return (False)
        return (True)

def maxPrimeFactors(n):
    maxPrime = -1
    while n % 2 == 0:
        maxPrime = 2
        n >>= 1
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        while n % i == 0:
            maxPrime = i
            n = n / i
    if n > 2:
        maxPrime = n
    return int(maxPrime)
def countcon(s,i):
    c=0
    ch=s[i]
    for i in range(i,len(s)):
        if(s[i]==ch):
            c+=1
        else:
            break

    return(c)
n,k=map(int,input().split())
l=list(map(int,input().split()))
s=input()
ans=sum(l)
i=0
while(i<n):
    c=countcon(s,i)
    if(c>k):
        t=sorted(l[i:i+c])
        ans-=sum(t[:c-k])
    i+=c
print(ans)


n,k=[int(x) for x in input().split()]
num=[int(x) for x in input().split()]
s=list(input())
literal=s[0]
total=[]
pref=[]
for item in range(n):
    if s[item]==literal:
        pref.append(num[item])
    else:
        total.append(pref)
        pref=[num[item]]
        literal=s[item]
total.append(pref)
brutality=0
for item in total:
    item.sort(reverse=True)
    for i in range(min(k,len(item))):
        brutality+=item[i]
print(brutality)


n, k = map(int, input().split())
a = [int(i) for i in input().split()]
s = list(input())
i = 0
b = []
cnt = 0
if n == 1:
    print(a[0])
else:
    while i != n - 1:
        b.append((s[i], a[i]))
        if s[i] != s[i + 1]:
            b.sort(reverse=True)
            j = 0
            while j < len(b) and j < k:
                cnt += b[j][1]
                j += 1
            b = []
        i += 1
    b.append((s[-1], a[-1]))
    b.sort(reverse=True)
    j = 0
    while j < len(b) and j < k:
        cnt += b[j][1]
        j += 1
    print(cnt)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=str(input())
x=[]
st=[]
for i in range(len(s)):

	if(i!=0 and s[i]!=s[i-1]):
		x.append(st)
		st=[a[i]]

	elif(i==0):
		st=[a[i]]
	else:
		st.append(a[i])
	if(i==n-1):
			x.append(st)
dm=0
for i in x:
	if(len(i)>=k):
		i.sort(reverse=True)
		for j in range(k):
			if(j<len(i)):
				dm+=i[j]
	else:
		dm+=sum(i)
			#print(i[j])
print(dm)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=str(input())
x=[]
st=[]
for i in range(len(s)):

	if(i!=0 and s[i]!=s[i-1]):
		x.append(st)
		st=[a[i]]
		if(i==n-1):
			x.append(st)
	elif(i==0):
		st=[a[i]]
	else:
		st.append(a[i])
		if(i==n-1):
			x.append(st)
dm=0
for i in x:
	i.sort(reverse=True)
	for j in range(k):
		if(j<len(i)):
			dm+=i[j]
			#print(i[j])
print(dm)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=str(input())
x=[]
st=[]
for i in range(len(s)):

	if(i!=0 and s[i]!=s[i-1]):
		x.append(st)
		st=[a[i]]
		if(i==n-1):
			x.append(st)
	elif(i==0):
		st=[a[i]]
	else:
		st.append(a[i])
		if(i==n-1):
			x.append(st)
dm=0
for i in x:
	if(len(i)>=k):
		i.sort(reverse=True)
		for j in range(k):
			if(j<len(i)):
				dm+=i[j]
	else:
		dm+=sum(i)
			#print(i[j])
print(dm)


n, k = map(int, input().split())
a = list(map(int, input().split()))
str = input()
str = str + 'E'

s = sum(a)

len = 1
al = ar = 0
for i in range(n):
    if (str[i] == str[i+1]):
        len += 1
    else:
        if (len > k):
            a_sub = []
            ar = i
            for j in range(al, ar + 1):
                a_sub.append(a[j])
            a_sub.sort()
            s_sub = 0
            for q in range(len - k):
                s_sub += a_sub[q]
            s -= s_sub
        al = i + 1
        len = 1
print(s)


import sys
from heapq import heappush , heappop
def get_array(): return list(map(int, sys.stdin.readline().split()))
def get_ints(): return map(int, sys.stdin.readline().split())
def input(): return sys.stdin.readline().strip('\n')

n , k = get_ints()
a = get_array()
s = list(input())

heap = []

ans = i = 0
flag = False
while i < n:
    heappush(heap,-a[i])
    j = i+1
    while j < n and s[i] == s[j]:
        heappush(heap,-a[j])
        j+=1

    count = 0
    while( len(heap) != 0 ):
        count+=1
        item = -heappop(heap)
        if count > k:
            pass
        else:
            ans += item

    i = j

print(ans)


n, k = input().split()
n = int(n)
k = int(k)
dmg = list(map(int, input().split()))
s = input()
res = 0
tmp = [dmg[0]]
for i in range(1, n):
    if s[i] == s[i-1]:
        tmp.append(dmg[i])
    else:
        tmp = list(reversed(sorted(tmp)))
        res += sum(tmp[:k])
        tmp = [dmg[i]]

tmp = list(reversed(sorted(tmp)))
res += sum(tmp[:k])
print(res)


n,k=map(int,input().split())
l=list(map(int,input().split()))
s=input()
s=list(s)
#l1=list(zip(l,s))

'''key=''
d=dict()
for i in l1:
	key=i[1]

	if key not in d:
		d[key]=list()
	d[key].append(i[0])'''

'''print(d)
su=0
for i in d.values():
	count=0
	while(count<k and len(i)!=0):
		su=su+max(i)
		i.remove(max(i))
		#print(i)
		count=count+1
print(su)'''
'''i=0
su=0
while(i!=n):
	key=s[i]
	j=i
	l2=[]
	l3=[]
	#print(key)
	if(j<len(l)-1 and s[j+1]==key):
		while(s[j]==key and j<len(l)-1):
			l2.append(l[j])
			print(s[j])
			print(j)
			j=j+1

		l2=sorted(l2,reverse=True)
		i=j+1
		if(len(l2)<k):
			su=su+sum(l2)
		else:
			#print(l2[:k])
			su=su+sum(l2[:k])
	else:
		#l3.append(l[i])
		su=su+l[i]
		i=i+1
	print(l2)
	#print(su)

	#print(l2,l3)
	#print(j)#l1=sorted(l1, key="reversed")
	#print(l2)

#print(su)'''

i=0
ans=0
while(i<n):
	key=s[i]
	l2=[]
	l3=[]
	j=i

	if(j<n-1 and s[j+1]==key):
		while( j<n and s[j]==key):

			l2.append(l[j])
			j=j+1

		#print(l2)
		i=j
		l2=sorted(l2,reverse=True)
		if(len(l2)<k):
			ans=ans+sum(l2)
		else:
			ans=ans+sum(l2[:k])

	else:
		ans=ans+l[i]
		i=i+1
	#print(l2,l3)
print(ans)


n,k=map(int,input().split())
l=list(map(int,input().split()))
s=input()
s=list(s)
#l1=list(zip(l,s))

i=0
ans=0
while(i<n):
	key=s[i]
	l2=[]
	l3=[]
	j=i

	if(j<n-1 and s[j+1]==key):
		while( j<n and s[j]==key):

			l2.append(l[j])
			j=j+1

		#print(l2)
		i=j
		l2=sorted(l2,reverse=True)
		if(len(l2)<k):
			ans=ans+sum(l2)
		else:
			ans=ans+sum(l2[:k])

	else:
		ans=ans+l[i]
		i=i+1
	#print(l2,l3)
print(ans)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=input()

i=0
res=0

while i<len(s):
    j=i
    while(i+1<len(s) and s[i+1]==s[i]):
        i+=1
    res+=sum(sorted(a[j:i+1])[-k:])
    i+=1
print(res)


n, k = map(int, input().split())
a = list(map(int, input().split()))
s = input()
ans = 0
i = 0
while i < n:
	j = i
	b = []
	while j<n and s[i]==s[j]:
		b.append(a[j])
		j += 1
	b.sort(reverse=True)
	ans += sum(b[0:min(len(b),k)])
	i = j
print(ans)


n, k = map(int, input().split())
A = list(map(int, input().split()))
s = input()

sf = 0

tot = 0

while(sf < n):
	c = s[sf]
	t = sf + 1
	while(t < n and s[t] == c):
		t += 1
	sl = sorted(A[sf:t], reverse=True)
	if t - sf > k:
		tot += sum(sl[:k])
	else:
		tot += sum(sl)
	sf = t

print(tot)


n,k=[*map(int,input().split())]
a=[*map(int,input().split())]
s=input()
b=[]
ans=[]
count=0
su=0
c=[]
for i in range(0,n-1):
    if s[i]==s[i+1]:
        if i==n-2:
            count+=1
            b.append(i)
            b.append(i+1)
            ans.append(b)
        else:
            b.append(i)
    else:
        b.append(i)
        ans.append(b)
        b=[]
if count!=1:
        b.append(n-1)
        ans.append(b)
for i in ans:
    if len(i)<=k:
        for j in i:
            su+=a[j]
    else:
        for j in i:
            c.append(a[j])
        c.sort()
        c=c[::-1]
        for l in range(0,k):
            su+=c[l]
        c=[]
print(su)


n,k=map(int,input().split())
l=list(map(int,input().split()))
s=str(input())
t=0
i=0
while(i<n):
    j=i
    p=[]
    while(j<n and s[i]==s[j]):
        p.append(l[j])
        j+=1
    p.sort(reverse=True)
    c=min(k,len(p))
    t=t+sum(p[0:c])
    i=j
print(t)


n, k = map(int, input().split())
a = [int(num) for num in input().split()]
s = input()
stack = []
count = 0
bool_arr = [True]*n
for i in range(n):
    if not stack:
        stack.append(i)
        count += 1
    elif s[i] != s[i-1]:
        stack = [i]
        count = 1
    else:
        if count < k:
            if a[stack[-1]] >= a[i]:
                stack.append(i)
                count += 1
            else:
                count += 1
        else:
            if a[i] > a[stack[-1]]:
                bool_arr[stack[-1]] = False
                stack.pop()
                if (not stack) or a[stack[-1]] >= a[i]:
                    stack.append(i)
            else:
                bool_arr[i] = False
points = 0

for i in range(n):
    if bool_arr[i]:
        points += a[i]
print(points)


n, k = map(int, input().split())
a = [int(num) for num in input().split()]
s = input()
stack = []
count = 0
maxm = 0
for i in range(n):
    if not stack:
        stack.append(a[i])
        count += 1
    elif s[i] != s[i-1]:
        stack.sort()
        maxm += sum(stack[-1*k:])
        stack = [a[i]]
        count = 1
    else:
        count += 1
        stack.append(a[i])
stack.sort()
maxm += sum(stack[-1*k:])
print(maxm)


n,k = map(int,input().split())
a =list(map(int,input().split()))
s = input()
i = 0
b = []
dmg = 0
c = 0
while i<=n-1:
    m=s[i]
    while  i<=n-1 and s[i]==m :
        b.append(a[i])
        i+=1
    b = sorted(b)
    for j in range(len(b)):
        if c<k:
            dmg+=b[len(b)-1]
            del b[len(b)-1]
            c+=1
        else:
            break
    c = 0
    b = []
print(dmg)


from collections import defaultdict

n, k = map(int, input().split())
mas = list(map(int, input().split()))
s = list(input())
sm = 0;
new_mas = [mas[0]]
for i in range(1, len(s)):
    if s[i - 1] == s[i]:
        new_mas.append(mas[i])
    else:
        new_mas.sort(reverse = True)
        sm += sum(new_mas[:k])
        new_mas = []
        new_mas.append(mas[i])
        continue
new_mas.sort(reverse = True)
sm += sum(new_mas[:k])
print(sm)


n, k = list(map(int, input().split()))
pl =  list(map(int, input().split()))
s = input()
count = 1

res = 0
for i in range(n-1):
  if s[i]==s[i+1]:
    count+=1
  else:
    if count>k:
      el = sorted(pl[i-count+1: i+1])
      res+=sum(el[count-k:])
      count = 1
    else:
      count = 1
      res+=pl[i]

if count>k:
  el = sorted(pl[n-count:])
  res+=sum(el[count-k:])
else:
  el = pl[n-count:]
  res+=sum(el)

print(res)


n, k = list(map(int, input().split()))
pl =  list(map(int, input().split()))
s = input()
count = 1

res = 0
for i in range(n-1):
  if s[i]==s[i+1]:
    count+=1
  else:
    if count>k:
      el = sorted(pl[i-count+1: i+1])
      res+=sum(el[count-k:])
      count = 1
    else:
      res+=sum(pl[i-count+1: i+1])
      count = 1

if count>k:
  el = sorted(pl[n-count:])
  res+=sum(el[count-k:])
else:
  el = pl[n-count:]
  res+=sum(el)

print(res)


n,k = map(int,input().split())
a = (list(map(int,input().split())))
s = list(input())
count = 0
l = [a[0]]
le = 1
for i in range(1,n):
	if s[i] != s[i-1]:
		l.sort(reverse=True)
		count+=sum(l[:min(le,k)])
		l = [a[i]]
		le = 1
	else:
		le+=1
		l.append(a[i])
l.sort(reverse=True)
count+=sum(l[:min(le,k)])
print(count)


n,k=map(int,input().split())
a=list(map(int,input().split()))
s=input()
dmg=0
count=1
i=0
while i!=n-1:
        if s[i]==s[i+1]:
                for j in range(i+2,n):
                        if s[j]!=s[i]:
                                r=s[i:j]
                                break
                        if j==n:
                                r=s[i:n+1]
                                break
                if len(r)>k:
                        ma=sum(a[i:i+k])
                        for z in range(len(r)-k+1):
                                if sum(a[z+i:z+i+k])>ma:
                                        ma=sum(a[z+i:z+i+k])
                else:
                        ma=sum(a[i:j])
                dmg+=ma
                i+=len(r)
        else:
                dmg+=a[i]
                i+=1
if s[n-1]!=s[n-2]:
        dmg+=a[n-1]
print(dmg)


from sys import stdin,stdout
#import operator
#from collections import OrderedDict
#def getKey(item):
#     return item[0]
n,k=map(int,stdin.readline().rstrip().split(" "))
lst=list(map(int,stdin.readline().rstrip().split()))
s=stdin.readline()
#l=[0]*n
#for i in range(n):
#    l[i]=[lst[i],s[i]]

#l=sorted(l, key=getKey,reverse=True)
ss=0
#print(l)
"""for i,j in l :
    if j not in cnt:
        cnt[j]=1
        ss+=i
        cnt[j]+=1
        #print(i,j)
    else:
        if cnt[j]<=k:
            #print(i,j)
            ss+=i
            cnt[j]+=1"""
s+=' '
#l.append([0,'zz'])
num=[]
sss=0
i=0
while i<n:
    cnt=0
    sss=0
    if s[i]==s[i+1]:
        for j in range(i,n):
            num.append(lst[j])
            cnt+=1
            sss+=lst[j]
            if s[j]!=s[j+1]:
                break
        i+=cnt
        #if cnt<=k:
        #    ss+=sss
        #    else:
        num.sort(reverse=True)
        for j in range(k):
            ss+=num[j]

        num=[]
    else:
        ss+=lst[i]
        i+=1

print(ss)


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
typedef long long LL;
char s[maxn];
int main()
{
            int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            scanf("%s",s);
            int cnt=0,flag0=0;
/*
            for(int i=1;i<=n;i++)
        {
            scanf("%1d",&s[i]);
            if(s[i]==0 && ( s[i-1]==1||i==1 ))
			cnt++;
        }
*/
            s[n]='1';
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                        flag0=0;
                    }
                }
            }

       //printf("%d\n",cnt);
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       LL ans;
       if(x<y)
       {
           ans=(LL)(cnt-1)*x+y;
           printf("%I64d\n",ans);
       }
       else {
       ans=(LL)y*cnt;
       printf("%I64d\n",ans);
       }

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
typedef long long LL;
int s[maxn];
int main()
{
            int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            //scanf("%s",s);
            int cnt=0,flag0=0;

            for(int i=1;i<=n;i++)
        {
            scanf("%1d",&s[i]);
            if(s[i]==0 && ( s[i-1]==1||i==1 ))
			cnt++;
        }
/*
            s[n]='1';
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                        flag0=0;
                    }
                }
            }
*/
       //printf("%d\n",cnt);
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       LL ans;
       if(x<y)
       {
           ans=LL(x*(cnt-1)+y);
           printf("%I64d\n",ans);
       }
       else {
       ans=LL(y*cnt);
       printf("%I64d\n",ans);
       }

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
typedef long long LL;
int s[maxn];
int main()
{
            int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            //scanf("%s",s);
            int cnt=0,flag0=0;

            for(int i=1;i<=n;i++)
        {
            scanf("%1d",&s[i]);
            if(s[i]==0 && ( s[i-1]==1||i==0 ))
			cnt++;
        }
/*
            s[n]='1';
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                        flag0=0;
                    }
                }
            }
*/
       //printf("%d\n",cnt);
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       LL ans;
       if(x<y)
       {
           ans=LL(x*(cnt-1)+y);
           printf("%I64d\n",ans);
       }
       else {
       ans=LL(y*cnt);
       printf("%I64d\n",ans);
       }

    return 0;
}


#include<stdio.h>
#define LL long long
int a[300005];
int main(void)
{
	int n, x, y, i, sum;
	scanf("%d%d%d", &n, &x, &y);
	sum = 0;
	for(i=1;i<=n;i++)
	{
		scanf("%1d", &a[i]);
		if(a[i]==0 && (a[i-1]==1 || i==1))
			sum++;
	}
	if(sum==0)
		printf("0\n");
	else if(x<y)
		printf("%I64d\n", (LL)(sum-1)*x+y);
	else
		printf("%I64d\n", (LL)sum*y);
	return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
typedef long long LL;
int s[maxn];
int main()
{
            int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            //scanf("%s",s);
            int cnt=0,flag0=0;

            for(int i=1;i<=n;i++)
        {
            scanf("%1d",&s[i]);
            if(s[i]==0 && ( s[i-1]==1||i==1 ))
			cnt++;
        }
/*
            s[n]='1';
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                        flag0=0;
                    }
                }
            }
*/
       //printf("%d\n",cnt);
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       LL ans;
       if(x<y)
       {
           ans=(LL)(cnt-1)*x+y;
           printf("%I64d\n",ans);
       }
       else {
       ans=(LL)y*cnt;
       printf("%I64d\n",ans);
       }

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
typedef long long LL;
char s[maxn];
int main()
{
            int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            scanf("%s",s);
            int cnt=0,flag0=0;
            s[n]='1';
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                        flag0=0;
                    }
                }
            }
       //printf("%d\n",cnt);
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       LL ans;
       if(x<y)
       {
           ans=x*(cnt-1)+y;
           printf("%lld\n",ans);
       }
       else {
       ans=y*cnt;
       printf("%lld\n",ans);
       }

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
typedef long long LL;
char s[maxn];
int main()
{
            int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            scanf("%s",s);
            int cnt=0,flag0=0;
            s[n]='1';
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                    }
                    flag0=0;
                }
       }
       //printf("%d\n",cnt);
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       LL ans;
       if(x<y)
       {
           ans=x*(cnt-1)+y;
           printf("%lld\n",ans);
       }

       else {
       ans=y*cnt;
       printf("%lld\n",ans);
       }

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
typedef long long LL;
char s[maxn];
int main()
{
            int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            scanf("%s",s);
            int cnt=0,flag0=0;

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

            if(s[i]=='0' && (i==0 ||s[i-1]=='1' ))
			cnt++;
        }

            /*
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                        flag0=0;
                    }
                }
            }
            */
       //printf("%d\n",cnt);
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       LL ans;
       if(x<y)
       {
           ans=LL(x*(cnt-1)+y);
           printf("%I64d\n",ans);
       }
       else {
       ans=LL(y*cnt);
       printf("%I64d\n",ans);
       }

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
char s[maxn];
int main()
{
       int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            scanf("%s",s);
            int cnt=0,flag0=0;
            s[n]='1';
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                    }
                    flag0=0;
                }
       }
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       if(x<y)
       printf("%d\n",x*(cnt-1)+y);
       else {
       printf("%d\n",y*cnt);
       }

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
const int maxn=300005;
typedef long long LL;
char s[maxn];
int main()
{
            int n,x,y;
            scanf("%d%d%d",&n,&x,&y);
            scanf("%s",s);
            int cnt=0,flag0=0;
/*
            for(int i=0;i<n;i++)
        {

            if(s[i]=='0' && (i==0 ||s[i-1]=='1' ))
			cnt++;
        }
*/
            s[n]='1';
            for(int i=0;i<=n;i++)
            {
                if(s[i]=='0')
                {
                    flag0=1;
                }
                if(s[i]=='1')
                {
                    if(flag0==1)
                    {
                        cnt++;
                        flag0=0;
                    }
                }
            }
       //printf("%d\n",cnt);
       if(cnt==0)
       {
           printf("0\n");
           return 0;
       }
       LL ans;
       if(x<y)
       {
           ans=LL(x*(cnt-1)+y);
           printf("%I64d\n",ans);
       }
       else {
       ans=LL(y*cnt);
       printf("%I64d\n",ans);
       }

    return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 3e5 + 4;
char s[MaxN];
LL x,y;
int main(){
	int n;
	cin>>n>>x>>y;
	cin>>s+1;
	bool ok = false;
	for(int i = 1; i <= n; i++){
		if(s[i] == '0') ok = true;
	}
	if(ok == false) cout<<"0"<<endl;
	else {
		int no = 0;
		int odd = 0, even = 0;
		if(s[1] == '0'){
			no = 1;
			for(int i = 1; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					odd++;
					even++;
				}
			}
			if(s[n] == '0') odd++;
			else even--;
		}
		else if(s[1] == '1'){
			no = 2;
			for(int i = 1; i < n; i++){
				if(s[i] == '1' && s[i+1] == '0'){
					even++;
					odd++;
				}
			}
			if(s[n] == '1') even++;
			else odd--;
		}
		int ans = 0;
		cout<<odd<<" "<<even<<endl;
		if(y < x){
			ans = y*odd;
		}
		else if(x < y){
			//if(no == 1) ans =
			ans = x*even+y;
		}
		else {
			ans = y*odd;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 3e5 + 4;
char s[MaxN];
LL x,y;
int main(){
	int n;
	cin>>n>>x>>y;
	cin>>s+1;
	bool ok = false;
	for(int i = 1; i <= n; i++){
		if(s[i] == '0') ok = true;
	}
	if(ok == false) cout<<"0"<<endl;
	else {
		int odd = 0, even = 0;
		if(s[1] == '0'){
			for(int i = 1; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					odd++;
					even++;
				}
			}
			if(s[n] == '0') odd++;
		}
		else if(s[1] == '1'){
			for(int i = 1; i < n; i++){
				if(s[i] == '1' && s[i+1] == '0'){
					even++;
					odd++;
				}
			}
			if(s[n] == '1') even++;
		}
		int ans = 0;
		//cout<<odd<<" "<<even<<endl;
		if(y < x){
			ans += y*odd;
		}
		else if(x < y){
			ans += x*even+y;
		}
		else {
			ans = min(odd,even)*y;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 3e5 + 4;
char s[MaxN];
LL x,y;
int main(){
	int n;
	cin>>n>>x>>y;
	cin>>s+1;
	bool ok = false;
	for(int i = 1; i <= n; i++){
		if(s[i] == '0') ok = true;
	}
	if(ok == false) cout<<"0"<<endl;
	else {
		LL odd = 0, even = 0;
		if(s[1] == '0'){
			for(int i = 1; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					odd++;
					even++;
				}
			}
			if(s[n] == '0') odd++;
			else even--;
		}
		else if(s[1] == '1'){
			for(int i = 2; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					even++;
					odd++;
				}
			}
			if(s[n] == '1') even--;
			else odd--;
		}
		LL ans = 0;
		if(y < x){
			ans = abs(y*odd);
		}
		else if(x < y){
			ans = x*even+y;
		}
		else {
			ans = y*odd;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 3e5 + 4;
char s[MaxN];
LL x,y;
int main(){
	int n;
	cin>>n>>x>>y;
	cin>>s+1;
	bool ok = false;
	for(int i = 1; i <= n; i++){
		if(s[i] == '0') ok = true;
	}
	if(ok == false) cout<<"0"<<endl;
	else {
		LL odd = 0, even = 0;
		if(s[1] == '0'){
			for(int i = 1; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					odd++;
					even++;
				}
			}
			if(s[n] == '0') odd++;
			else even--;
		}
		else if(s[1] == '1'){
			for(int i = 2; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					even++;
					odd++;
				}
			}
			if(s[n] == '1') even--;
			else odd--;
		}
		LL ans = 0;
		if(y < x){
			ans = y*odd;
		}
		else if(x < y){
			ans = x*even+y;
		}
		else {
			ans = y*odd;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 3e5 + 4;
char s[MaxN];
LL x,y;
int main(){
	int n;
	cin>>n>>x>>y;
	cin>>s+1;
	bool ok = false;
	for(int i = 1; i <= n; i++){
		if(s[i] == '0') ok = true;
	}
	if(ok == false) cout<<"0"<<endl;
	else {
		LL odd = 0, even = 0;
		if(s[1] == '0'){
			for(int i = 1; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					odd++;
					even++;
				}
			}
			if(s[n] == '0') odd++;
			else even--;
		}
		else if(s[1] == '1'){
			for(int i = 2; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					even++;
					odd++;
				}
			}
			if(s[n] == '0') odd++;
			else even--;
		}
		LL ans = 0;
		if(y < x){
			ans = y*odd;
		}
		else if(x < y){
			ans = x*even+y;
		}
		else {
			ans = y*odd;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 3e5 + 4;
char s[MaxN];
LL x,y;
int main(){
	int n;
	cin>>n>>x>>y;
	cin>>s+1;
	bool ok = false;
	for(int i = 1; i <= n; i++){
		if(s[i] == '0') ok = true;
	}
	if(ok == false) cout<<"0"<<endl;
	else {
		int no = 0;
		int odd = 0, even = 0;
		if(s[1] == '0'){
			no = 1;
			for(int i = 1; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					odd++;
					even++;
				}
			}
			if(s[n] == '0') odd++;
			else even--;
		}
		else if(s[1] == '1'){
			no = 2;
			for(int i = 1; i < n; i++){
				if(s[i] == '1' && s[i+1] == '0'){
					even++;
					odd++;
				}
			}
			if(s[n] == '1') even++;
			else odd--;
		}
		int ans = 0;
		//cout<<odd<<" "<<even<<endl;
		if(y < x){
			ans = y*odd;
		}
		else if(x < y){
			//if(no == 1) ans =
			ans = x*even+y;
		}
		else {
			ans = y*odd;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 3e5 + 4;
char s[MaxN];
LL x,y;
int main(){
	int n;
	cin>>n>>x>>y;
	cin>>s+1;
	bool ok = false;
	for(int i = 1; i <= n; i++){
		if(s[i] == '0') ok = true;
	}
	if(ok == false) cout<<"0"<<endl;
	else {
		int no = 0;
		LL odd = 0, even = 0;
		if(s[1] == '0'){
			no = 1;
			for(int i = 1; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					odd++;
					even++;
				}
			}
			if(s[n] == '0') odd++;
			else even--;
		}
		else if(s[1] == '1'){
			no = 2;
			for(int i = 1; i < n; i++){
				if(s[i] == '1' && s[i+1] == '0'){
					even++;
					odd++;
				}
			}
			//if(s[1] == '1') even--;
			if(s[n] == '1') even--;
			else odd--;
		}
		LL ans = 0;
		//cout<<odd<<" "<<even<<endl;
		if(y < x){
			ans = y*odd;
		}
		else if(x < y){
			//if(no == 1) ans =
			ans = x*even+y;
		}
		else {
			ans = y*odd;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 3e5 + 4;
char s[MaxN];
LL x,y;
int main(){
	int n;
	cin>>n>>x>>y;
	cin>>s+1;
	bool ok = false;
	for(int i = 1; i <= n; i++){
		if(s[i] == '0') ok = true;
	}
	if(ok == false) cout<<"0"<<endl;
	else {
		int no = 0;
		int odd = 0, even = 0;
		if(s[1] == '0'){
			no = 1;
			for(int i = 1; i < n; i++){
				if(s[i] == '0' && s[i+1] == '1'){
					odd++;
					even++;
				}
			}
			if(s[n] == '0') odd++;
			else even--;
		}
		else if(s[1] == '1'){
			no = 2;
			for(int i = 1; i < n; i++){
				if(s[i] == '1' && s[i+1] == '0'){
					even++;
					odd++;
				}
			}
			//if(s[1] == '1') even--;
			if(s[n] == '1') even--;
			else odd--;
		}
		int ans = 0;
		//cout<<odd<<" "<<even<<endl;
		if(y < x){
			ans = y*odd;
		}
		else if(x < y){
			//if(no == 1) ans =
			ans = x*even+y;
		}
		else {
			ans = y*odd;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,x,y;
int m;
int num[310000];
long long ans=0;
long long nval=0;
int nloc=1,val;
long long ocnt,zcnt;
char ch[500000];
int main() {
	num[0]=123123;
	scanf("%d%d%d",&n,&x,&y);
	scanf("%s",ch+1);
	for(int i=1;i<=n;++i) {
		val=ch[i]-'0';
		if(val!=num[nloc-1]) {
			num[nloc++]=val;
		}
	}
	n=nloc-1;
	for(int i=1;i<=n;++i) {
		if(num[i]==1)
			if(i!=1&&i!=n) ++ocnt;
		if(num[i]==0)++zcnt;
	}
	if(zcnt==0) {
		printf("0");
		return 0;
	}
	ans=0x3f3f3f3f3f3f3f3f;
	nval=1ll*x*ocnt+y;
	ans=min(ans,nval);
	nval=y*zcnt;
	ans=min(ans,nval);
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,x,y;
int m;
int num[310000];
long long ans=0;
long long nval=0;
int nloc=1,val;
long long ocnt,zcnt;
char ch[500000];
int main() {
	num[0]=123123;
	scanf("%d%d%d",&n,&x,&y);
	scanf("%s",ch+1);
	for(int i=1;i<=n;++i) {
		val=ch[i]-'0';
		if(val!=num[nloc-1]) {
			num[nloc++]=val;
		}
	}
	n=nloc-1;
	for(int i=1;i<=n;++i) {
		if(num[i]==1&&i!=1&&i!=n) ++ocnt;
		else ++zcnt;
	}
	if(zcnt==0) {
		printf("0");
		return 0;
	}
	ans=0x3f3f3f3f3f3f3f3f;
	nval=1ll*x*ocnt+y;
	ans=min(ans,nval);
	nval=y*zcnt;
	ans=min(ans,nval);
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,x,y;
int m;
int num[310000];
long long ans=0;
long long nval=0;
int nloc=1,val;
long long ocnt,zcnt;
char ch[500000];
int main() {
	num[0]=123123;
	scanf("%d%d%d",&n,&x,&y);
	scanf("%s",ch+1);
	for(int i=1;i<=n;++i) {
		val=ch[i]-'0';
		if(val!=num[nloc-1]) {
			num[nloc++]=val;
		}
	}
	n=nloc-1;
	for(int i=1;i<=n;++i) {
		if(num[i]==1)
			if(i!=1&&i!=n)++ocnt;
		else ++zcnt;
	}
	if(zcnt==0) {
		printf("0");
		return 0;
	}
	ans=0x3f3f3f3f3f3f3f3f;
	nval=1ll*x*ocnt+y;
	ans=min(ans,nval);
	nval=y*zcnt;
	ans=min(ans,nval);
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,x,y;
int m;
int num[310000];
long long ans=0;
long long nval=0;
int nloc=1,val;
long long ocnt,zcnt;
char ch[500000];
int main() {
	num[0]=123123;
	scanf("%d%d%d",&n,&x,&y);
	scanf("%s",ch+1);
	for(int i=1;i<=n;++i) {
		val=ch[i]-'0';
		if(val!=num[nloc-1]) {
			num[nloc++]=val;
		}
	}
	n=nloc-1;
	for(int i=1;i<=n;++i) {
		if(num[i]==1) ++ocnt;
		else ++zcnt;
	}
	if(zcnt==0) {
		printf("0");
		return 0;
	}
	ans=0x3f3f3f3f3f3f3f3f;
	nval=1ll*x*ocnt+y;
	ans=min(ans,nval);
	nval=y*zcnt;
	ans=min(ans,nval);
	cout<<ans;
	return 0;
}


#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.h>
#else
#define debug(x) ((void)0)
#define range(x, y) ((void)0)
#define endln ((void)0)
#endif

using namespace std;

const int maxn = 3e5 + 5;

int n, x, y;
char s[maxn];

long long solve() {
    long long cnt[2] = {};
    for (int i = 1; i <= n; ++i) {
        ++cnt[s[i] - '0'];
    }
    cnt[1] -= s[1] == '1';
    cnt[1] -= s[n] == '1';
    if (cnt[1] < 0) {
        return 0;
    }
    return min(y * cnt[0], cnt[1] * min(x, y) + !(n == 1 && cnt[0] == 0) * y);
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    scanf("%d%d%d", &n, &x, &y);
    scanf("%s", s + 1);
    n = unique(s + 1, s + n + 1) - s - 1;
    long long ans = solve();
    for (int i = 1; i <= n; ++i) {
        s[i] = s[i] == '0' ? '1' : '0';
    }
    ans = min(ans, solve() + y);
    printf("%I64d\n", ans);
    return 0;
}


#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.h>
#else
#define debug(x) ((void)0)
#define range(x, y) ((void)0)
#define endln ((void)0)
#endif

using namespace std;

const int maxn = 3e5 + 5;

int n, x, y;
char s[maxn];

long long solve() {
    bool flag = true;
    for (int i = 1; i <= n; ++i) {
        flag &= s[i] == '1';
    }
    if (flag) {
        return 0;
    }
    s[0] = '0';
    int cnt = 0;
    for (int i = 1; i <= n; ++i) {
        cnt += s[i] == '1' && s[i - 1] == '0';
    }
    s[0] = '1';
    int tmp = 0;
    for (int i = 1; i <= n; ++i) {
        tmp += s[i] == '0' && s[i - 1] == '1';
    }
    if (cnt == 1 && (s[1] == '1' || s[n] == '1')) {
        cnt = 0;
    }
    long long ans = min(x * (long long)cnt + y, (long long)tmp * y);
    return ans;
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    scanf("%d%d%d", &n, &x, &y);
    scanf("%s", s + 1);
    long long ans = solve();
    for (int i = 1; i <= n; ++i) {
        s[i] = s[i] == '0' ? '1' : '0';
    }
    ans = min(ans, solve() + y);
    printf("%I64d\n", ans);
    return 0;
}


#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.h>
#else
#define debug(x) ((void)0)
#define range(x, y) ((void)0)
#define endln ((void)0)
#endif

using namespace std;

const int maxn = 3e5 + 5;

int n, x, y;
char s[maxn];

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    scanf("%d%d%d", &n, &x, &y);
    scanf("%s", s + 1);
    n = unique(s + 1, s + n + 1) - s - 1;
    long long cnt[2] = {};
    for (int i = 1; i <= n; ++i) {
        ++cnt[s[i] - '0'];
    }
    cnt[1] -= s[1] == '1' || s[n] == '1';
    long long ans = min(y * cnt[0], cnt[1] * min(x, y) + (cnt[1] < n) * y);
    printf("%I64d\n", ans);
    return 0;
}


#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.h>
#else
#define debug(x) ((void)0)
#define range(x, y) ((void)0)
#define endln ((void)0)
#endif

using namespace std;

const int maxn = 3e5 + 5;

int n, x, y;
char s[maxn];

long long solve() {
    long long cnt[2] = {};
    for (int i = 1; i <= n; ++i) {
        ++cnt[s[i] - '0'];
    }
    cnt[1] -= s[1] == '1';
    cnt[1] -= s[n] == '1';
    return min(y * cnt[0], cnt[1] * min(x, y) + !(n == 1 && cnt[0] == 0) * y);
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    scanf("%d%d%d", &n, &x, &y);
    scanf("%s", s + 1);
    n = unique(s + 1, s + n + 1) - s - 1;
    long long ans = solve();
    for (int i = 1; i <= n; ++i) {
        s[i] = s[i] == '0' ? '1' : '0';
    }
    ans = min(ans, solve() + y);
    printf("%I64d\n", ans);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
	ll n,a,b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	ll one = 0;
	ll zero = 0;
	for(ll i=0;i<n;i++){
		if(s[i]=='0')	zero++;
		else	one++;
	}
	if(one==n){
		printf("0\n");
	}
	else if(zero==n){
		printf("%lld\n",b);
	}
	else{
		ll seg = 0;
		for(ll i=0;i<n;i++){
			if(s[i]=='0'){
				seg++;
				while(i<n && s[i]=='0'){
					i++;
				}
			}
		}
		if(s[0]=='0' && s[n-1]=='0'){
			if(one>=2){
				printf("%lld\n",min(min(b*seg, 2*a+(seg-2)*b), a+(seg-1)*b));
			}
			else{
				printf("%lld\n",min(b*seg, a+(seg-1)*b));
			}
		}
		else{
			printf("%lld\n",b*seg);
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
	ll n,a,b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	ll one = 0;
	ll zero = 0;
	for(ll i=0;i<n;i++){
		if(s[i]=='0')	zero++;
		else	one++;
	}
	if(one==n){
		printf("0\n");
	}
	else if(zero==n){
		printf("%lld\n",b);
	}
	else{
		ll seg = 0;
		for(ll i=0;i<n;i++){
			if(s[i]=='0'){
				seg++;
				while(i<n && s[i]=='0'){
					i++;
				}
			}
		}
		ll ans = LLONG_MAX;
		for(ll i=0;i<seg;i++){
			ans = min(ans, i*a + (seg-i)*b);
		}
		printf("%lld\n",ans);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
	ll n,a,b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	ll one = 0;
	ll zero = 0;
	for(ll i=0;i<n;i++){
		if(s[i]=='0')	zero++;
		else	one++;
	}
	if(one==n){
		printf("0\n");
	}
	else if(zero==n){
		printf("%lld\n",b);
	}
	else{
		ll seg = 0;
		for(ll i=0;i<n;i++){
			if(s[i]=='0'){
				seg++;
				while(i<n && s[i]=='0'){
					i++;
				}
			}
		}
		if(s[0]=='0' && s[n-1]=='0'){
			printf("%lld\n",min(b*seg, a+(seg-1)*b));
		}
		else{
			printf("%lld\n",b*seg);
		}
	}
	return 0;
}


#include<iostream>
using namespace std;
long long n, x, y, l, ans, i;
string s;
int main(){
	cin >> n >> x >> y >> s;
	if(s[0]=='0') l++;
	for(i=1; i<n; i++){
		if(s[i]=='0'&&s[i-1]!='0'){
			l++;
		}
	}
	if(i==0){
		cout << 0 << endl;
		return 0;
	}
	ans=min(l*y,(l-1)*x+y);
	cout << ans << endl;
	return 0;
}


#include<iostream>
using namespace std;
long long n, x, y, l, ans, i;
string s;
int main(){
	cin >> n >> x >> y >> s;
	if(s[0]=='0') l++;
	for(i=1; i<n; i++){
		if(s[i]=='0'&&s[i-1]!='0'){
			l++;
		}
	}
	ans=min(l*y,(l-1)*x+y);
	cout << ans << endl;
	return 0;
}


#include<iostream>
using namespace std;
long long n, x, y, l, ans, i;
string s;
int main(){
	cin >> n >> x >> y >> s;
	if(s[0]=='0') l++;
	for(i=1; i<n; i++){
		if(s[i]=='0'&&s[i-1]!='0'){
			l++;
		}
	}
	if(l==0){
		cout << 0 << endl;
		return 0;
	}
	ans=min(l*y,(l-1)*x+y);
	cout << ans << endl;
	return 0;
}


#include<iostream>
using namespace std;
int n, x, y, l, ans;
int i;
string s;
int main(){
	cin >> n >> x >> y >> s;
	if(s[0]=='0') l++;
	for(i=1; i<n; i++){
		if(s[i]=='0'&&s[i-1]!='0'){
			l++;
		}
	}
	ans=min(l*y,(l-1)*x+y);
	cout << ans << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0, blocks1=0, f=0, f1=0;
    if(s[0]=='0')
        blocks++;
    if(s[0]=='1')
        blocks1++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
        if(s[i]=='1' && s[i-1]=='0')
            blocks1++;
    }

    ll ans = 0, ans1=0;

    if(s[n-1]=='0' && s[0]=='0' && blocks>2)
    {
        ans=-y+x;

    }
    else if(s[n-1]=='1' && s[0]=='1' && blocks>2)
    {
        ans1=-y+x;

    }

    if(blocks%2==0){
        ans += blocks/2 * x + blocks/2 * y;
    }
    else
        ans += blocks/2 * x + (blocks/2+1) * y;
    if(blocks1%2==0){
        ans1 = blocks1/2 * x + blocks1/2 * y;
    }
    else
        ans1 = blocks1/2 * x + (blocks1/2+1) * y;
    ans1 += y;
    cout<<min(min(ans1, ans), blocks*y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0, blocks1=0, f=0, f1=0;
    if(s[0]=='0')
        blocks++;
    if(s[0]=='1')
        blocks1++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
        if(s[i]=='1' && s[i-1]=='0')
            blocks1++;
    }

    ll ans = 0, ans1=0;

    if(blocks%2==0){
        ans += blocks/2 * x + blocks/2 * y;
    }
    else
        ans += (blocks/2+1) * x + (blocks/2) * y;
    if(blocks1%2==0){
        ans1 = blocks1/2 * x + blocks1/2 * y;
    }
    else
        ans1 = (blocks1/2+1) * x + (blocks1/2) * y;
    ans1 += y;
    cout<<min(min(ans1, ans), min(blocks*y, blocks1*y+y));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0, blocks1=0, f=0, f1=0;
    if(s[0]=='0')
        blocks++;
    if(s[0]=='1')
        blocks1++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
        if(s[i]=='1' && s[i-1]=='0')
            blocks1++;
    }

    ll ans = 0, ans1=0;
    if(blocks==1){
        cout<<y;
        return 0;
    }
    if(blocks==0){
        cout<<0;
        return 0;
    }

    if(blocks%2==0){
        ans += blocks/2 * x + blocks/2 * y;
    }
    else
        ans += (blocks/2+1) * x + (blocks/2) * y;
    if(blocks1%2==0){
        ans1 = blocks1/2 * x + blocks1/2 * y;
    }
    else
        ans1 = (blocks1/2+1) * x + (blocks1/2) * y;
    ans1 += y;
    cout<<(blocks-1)* min(x, y) + y;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0, blocks1=0, f=0, f1=0;
    if(s[0]=='0')
        blocks++;
    if(s[0]=='1')
        blocks1++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
        if(s[i]=='1' && s[i-1]=='0')
            blocks1++;
    }

    ll ans = 0, ans1=0;

    if(s[n-1]=='0' && s[0]=='0' && blocks>2)
    {
        ans=-y+x;

    }

    if(blocks%2==0){
        ans += blocks/2 * x + blocks/2 * y;
    }
    else
        ans += blocks/2 * x + (blocks/2+1) * y;
    if(blocks1%2==0){
        ans1 = blocks1/2 * x + blocks1/2 * y;
    }
    else
        ans1 = blocks1/2 * x + (blocks1/2+1) * y;
    ans1 += y;
    cout<<min(min(ans1, ans), blocks*y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0, blocks1=0, f=0, f1=0;
    if(s[0]=='0')
        blocks++;
    if(s[0]=='1')
        blocks1++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
        if(s[i]=='1' && s[i-1]=='0')
            blocks1++;
    }

    ll ans = 0, ans1=0;
    if(blocks==1){
        cout<<y;
        return 0;
    }

    if(blocks%2==0){
        ans += blocks/2 * x + blocks/2 * y;
    }
    else
        ans += (blocks/2+1) * x + (blocks/2) * y;
    if(blocks1%2==0){
        ans1 = blocks1/2 * x + blocks1/2 * y;
    }
    else
        ans1 = (blocks1/2+1) * x + (blocks1/2) * y;
    ans1 += y;
    cout<<min(min(ans1, ans), min(blocks*y, blocks1*y+y));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0, blocks1=0, f=0, f1=0;
    if(s[0]=='0')
        blocks++;
    if(s[0]=='1')
        blocks1++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
        if(s[i]=='1' && s[i-1]=='0')
            blocks1++;
    }

    ll ans = 0, ans1=0;

    if(s[n-1]=='0' && s[0]=='0' && blocks>2)
    {
        ans=-y+x;

    }
    else if(s[n-1]=='1' && s[0]=='1' && blocks>2)
    {
        ans1=-y+x;

    }

    if(blocks%2==0){
        ans += blocks/2 * x + blocks/2 * y;
    }
    else
        ans += blocks/2 * x + (blocks/2+1) * y;
    if(blocks1%2==0){
        ans1 = blocks1/2 * x + blocks1/2 * y;
    }
    else
        ans1 = blocks1/2 * x + (blocks1/2+1) * y;
    ans1 += y;
    cout<<min(min(ans1, ans), min(blocks*y, blocks1*y+y));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0, blocks1=0, f=0, f1=0;
    if(s[0]=='0')
        blocks++;
    if(s[0]=='1')
        blocks1++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
        if(s[i]=='1' && s[i-1]=='0')
            blocks1++;
    }

    ll ans = 0, ans1=0;

    if(s[n-1]=='0' && blocks>2)
    {
        ans=-y+x;

    }

    if(blocks%2==0){
        ans += blocks/2 * x + blocks/2 * y;
    }
    else
        ans += blocks/2 * x + (blocks/2+1) * y;
    if(blocks1%2==0){
        ans1 = blocks1/2 * x + blocks1/2 * y;
    }
    else
        ans1 = blocks1/2 * x + (blocks1/2+1) * y;
    ans1 += y;
    cout<<min(min(ans1, ans), blocks*y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0;
    if(s[0]=='0')
        blocks++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
    }
    ll ans = 0;
    if(blocks%2==0){
        ans = blocks/2 * x + blocks/2 * y;
    }
    else
        ans = blocks/2 * x + (blocks/2+1) * y;
    cout<<min(ans, blocks*y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[1000005];
int main(){
    int n;
    long long x, y;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    ll blocks=0, blocks1=0, f=0, f1=0;
    if(s[0]=='0')
        blocks++;
    if(s[0]=='1')
        blocks1++;
    for(int i=1; i<s.size(); i++){
        if(s[i]=='0' && s[i-1]=='1')
            blocks++;
        if(s[i]=='1' && s[i-1]=='0')
            blocks1++;
    }

    ll ans = 0, ans1=0;
    if(blocks==1){
        cout<<y;
        return 0;
    }

    if(blocks%2==0){
        ans += blocks/2 * x + blocks/2 * y;
    }
    else
        ans += (blocks/2+1) * x + (blocks/2) * y;
    if(blocks1%2==0){
        ans1 = blocks1/2 * x + blocks1/2 * y;
    }
    else
        ans1 = (blocks1/2+1) * x + (blocks1/2) * y;
    ans1 += y;
    cout<<(blocks-1)* min(x, y) + y;
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#include<iostream>
using namespace std;
#define ll long long
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define cross(i,k) for (register int i=first[k];i;i=last[i])
inline ll read(){
    ll x=0;int ch=getchar(),f=1;
    while (!isdigit(ch)&&(ch!='-')&&(ch!=EOF)) ch=getchar();
    if (ch=='-'){f=-1;ch=getchar();}
    while (isdigit(ch)){x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
    return x*f;
}
const int N = 3e5+10;
int n,x,y,tot,c[N],cnt[N];
char s[N];
ll ans,Ans;
int main(){
	n=read(),x=read(),y=read(),scanf("%s",s+1);
	For(i,1,n)
		if (s[i]!=s[i-1]) c[++tot]=s[i]-'0',cnt[tot]=1;
			else cnt[tot]++;
	For(i,1,tot)
		if (!c[i]) ans+=1ll*y;
	For(i,1,tot)
		if (c[i]) Ans+=x;
	if (tot>1) Ans-=1ll*x*(c[1]+c[tot]);
		else Ans-=1ll*x*c[1];
	Ans+=y;
	printf("%lld",min(ans,Ans));
}


#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#include<iostream>
using namespace std;
#define ll long long
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define cross(i,k) for (register int i=first[k];i;i=last[i])
inline ll read(){
    ll x=0;int ch=getchar(),f=1;
    while (!isdigit(ch)&&(ch!='-')&&(ch!=EOF)) ch=getchar();
    if (ch=='-'){f=-1;ch=getchar();}
    while (isdigit(ch)){x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
    return x*f;
}
const int N = 3e5+10;
int n,x,y,tot,c[N],cnt[N];
char s[N];
ll ans,Ans;
int main(){
	n=read(),x=read(),y=read(),scanf("%s",s+1);
	For(i,1,n)
		if (s[i]!=s[i-1]) c[++tot]=s[i]-'0',cnt[tot]=1;
			else cnt[tot]++;
	For(i,1,tot)
		if (!c[i]) ans+=1ll*y;
	For(i,1,tot)
		if (c[i]) Ans+=x;
	Ans-=1ll*x*(c[1]+c[tot]);
	Ans+=y;
	printf("%lld",min(ans,Ans));
}


#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define mp make_pair
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define endl '\n'
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
ll poww(ll x,ll y) {ll res=1;x%=mod; for(;y;y>>=1){if(y&1)res=res*x%mod;x=x*x%mod;}return res;}
using namespace std;

vector<int> v;

int main()
{
    fast;
    //freopen("input.txt", "r+", stdin);
    //freopen("output.txt", "w+", stdout);
    int n,i,j,k,x,y;
    ll ans=10000000000000000;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    for(i=0;i<n;++i){
        if(s[i]=='0'&&(i==0||s[i-1]=='1'))
            v.pb(i);
    }
    ans=min(x*(v.size()-1)+y,y*v.size());
    cout<<ans;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define mp make_pair
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define endl '\n'
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
ll poww(ll x,ll y) {ll res=1;x%=mod; for(;y;y>>=1){if(y&1)res=res*x%mod;x=x*x%mod;}return res;}
using namespace std;

vector<int> v;

int main()
{
    fast;
    //freopen("input.txt", "r+", stdin);
    //freopen("output.txt", "w+", stdout);
    int n,i,j,k,x,y;
    ll ans=10000000000000000;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    for(i=0;i<n;++i){
        if(s[i]=='0'&&(i==0||s[i-1]=='1'))
            v.pb(i);
    }
    j=v.size();
    ans=min(x*(j-1)+y,y*j);
    if(j==0)
        cout<<0;
    else
    cout<<ans;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define mp make_pair
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define endl '\n'
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
ll poww(ll x,ll y) {ll res=1;x%=mod; for(;y;y>>=1){if(y&1)res=res*x%mod;x=x*x%mod;}return res;}
using namespace std;

vector<int> v;

int main()
{
    fast;
    //freopen("input.txt", "r+", stdin);
    //freopen("output.txt", "w+", stdout);
    ll int n,i,j,k,x,y;
    ll ans=10000000000000000;
    cin>>n>>x>>y;
    string s;
    cin>>s;
    for(i=0;i<n;++i){
        if(s[i]=='0'&&(i==0||s[i-1]=='1'))
            v.pb(i);
    }
    j=v.size();
    ans=min(x*(j-1)+y,y*j);
    if(j==0)
        cout<<0;
    else
    cout<<ans;
    return 0;
}


#include<iostream>
using namespace std;
char p[300001];
int main()
{
    long long n,x,y;
    cin>>n>>x>>y;
    for(long long i=0;i<n;i++)
        cin>>p[i];
    long long  total=0;
    for(long i=0;i<n-1;i++)
        if(p[i]=='0'&&p[i+1]=='1'||p[i]=='1'&&p[i+1]=='0')
        total++;
    if(total==0)
    {
        if(p[0]=='0')
        {
            cout<<y<<endl;
            return 0;
        }
        cout<<0<<endl;
        return 0;
    }
    total=total/2+1;
    if(x>=y)
        cout<<(total)*y<<endl;
    else
        cout<<x*(total-1)+y<<endl;
}


#include<iostream>
using namespace std;
char p[300001];
int main()
{
    long long n,x,y;
    cin>>n>>x>>y;
    for(long long i=0;i<n;i++)
        cin>>p[i];
    long long  total=0;
    for(long i=0;i<n-1;i++)
        if(p[i]=='0'&&p[i+1]=='1'||p[i]=='1'&&p[i+1]=='0')
        total++;
    if(total==0)
    {
        if(p[0]=='0')
        {
            cout<<y<<endl;
            return 0;
        }
        cout<<0<<endl;
        return 0;
    }
    if(total==1)
    {
        cout<<y<<endl;
        return 0;
    }
    total=total/2+1;
    if(x>=y)
        cout<<(total)*y<<endl;
    else
        cout<<x*(total-1)+y<<endl;
}


#include<iostream>
using namespace std;
char p[300001];
int main()
{
    int n,x,y;
    cin>>n>>x>>y;
    for(int i=0;i<n;i++)
        cin>>p[i];
    long total=0;
    for(int i=0;i<n-1;i++)
        if(p[i]=='0'&&p[i+1]=='1'||p[i]=='1'&&p[i+1]=='0')
        total++;
    if(total==0)
    {
        if(p[0]=='0')
        {
            cout<<y<<endl;
            return 0;
        }
        cout<<0<<endl;
        return 0;
    }
    total=total/2+1;
    if(x>=y)
        cout<<(total)*y<<endl;
    else
        cout<<x*(total-1)+y<<endl;
}


#include<iostream>
using namespace std;
char p[300001];
int main()
{
    int n,x,y;
    cin>>n>>x>>y;
    for(int i=0;i<n;i++)
        cin>>p[i];
    long total=0;
    for(int i=0;i<n-1;i++)
        if(p[i]=='0'&&p[i+1]=='1'||p[i]=='1'&&p[i+1]=='0')
        total++;
    if(total==0)
    {
        if(p[0]=='0')
        {
            cout<<y<<endl;
            return 0;
        }
        cout<<0<<endl;
        return 0;
    }
    total=total/2+1;
    if(x>y)
        cout<<(total)*y<<endl;
    else
        cout<<x*(total-1)+y<<endl;
}


#include<iostream>
using namespace std;
char p[300001];
int main()
{
    long long n,x,y;
    cin>>n>>x>>y;
    for(long long i=0;i<n;i++)
        cin>>p[i];
    long long  total=0;
    long long num0=0,num1=0;
    for(long i=0;i<n-1;i++)
    {
        if(p[i]=='0'&&p[i+1]=='1')
        num0++;
        if(p[i]=='1'&&p[i+1]=='0')
            num1++;
    }
    if(num0>num1)
        total=num0;
    else
        total=num1;
    if(p[0]=='0'&&p[n-1]=='0')
        total++;
    if(total==0)
    {
        if(p[0]=='0')
        {
            cout<<y<<endl;
            return 0;
        }
        cout<<0<<endl;
        return 0;
    }
    if(total==1)
    {
        cout<<y<<endl;
        return 0;
    }
    //total=total/2+1;
    if(x>=y)
        cout<<(total)*y<<endl;
    else
        cout<<x*(total-1)+y<<endl;
}


#include<iostream>
using namespace std;
char p[300001];
int main()
{
    long long n,x,y;
    cin>>n>>x>>y;
    for(long long i=0;i<n;i++)
        cin>>p[i];
    long long  total=0;
    long long num0=0,num1=0;
    for(long i=0;i<n-1;i++)
    {
        if(p[i]=='0'&&p[i+1]=='1')
        num0++;
        if(p[i]=='1'&&p[i+1]=='0')
            num1++;
    }
    if(num0>num1)
        total=num0;
    else
        total=num1;
    if(p[0]=='0'&&p[n-1]=='0')
        total++;
    if(total==0)
    {
        if(p[0]=='0')
        {
            cout<<y<<endl;
            return 0;
        }
        cout<<0<<endl;
        return 0;
    }
    if(total==1)
    {
        cout<<y<<endl;
        return 0;
    }
    total=total/2+1;
    if(x>=y)
        cout<<(total)*y<<endl;
    else
        cout<<x*(total-1)+y<<endl;
}


#include<iostream>
using namespace std;
char p[300001];
int main()
{
    int n,x,y;
    cin>>n>>x>>y;
    for(int i=0;i<n;i++)
        cin>>p[i];
    long total=0;
    for(int i=0;i<n-1;i++)
        if(p[i]=='0'&&p[i+1]=='1'||p[i]=='1'&&p[i+1]=='0')
        total++;
    if(total==0)
    {
        cout<<0<<endl;
        return 0;
    }
    total=total/2+1;
    if(x>y)
        cout<<(total)*y<<endl;
    else
        cout<<x*(total-1)+y<<endl;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
using namespace std;
#define maxn 300020

typedef long long ll;
int n,x,y,cnt,tot;
ll cost;
char a[maxn];

int main(){
	scanf("%d %d %d",&n,&x,&y);
	scanf("%s",a + 1) , cnt = 1;
	for (int i = 1 ; i <= n ; i++){
		if ( a[i] == '1' ) tot++;
		if ( a[i] == '0' && a[i - 1] == '1' ) cnt++;
	}
	if ( tot == n ){ printf("0\n"); return 0; }
	if ( x > y ) cost = (ll)cnt * y;
	else cost = (ll)(cnt - 1) * x + y;
	cout<<cost;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
using namespace std;
#define maxn 300020

typedef long long ll;
int n,x,y,cnt,tot;
ll cost;
char a[maxn];

int main(){
	scanf("%d %d %d",&n,&x,&y);
	scanf("%s",a + 1);
	for (int i = 1 ; i <= n ; i++){
		if ( a[i] == '1' ) tot++;
		if ( a[i] == '0' && (a[i - 1] == '1' || i == 1) ) cnt++;
	}
	if ( tot == n ){ printf("0\n"); return 0; }
	if ( x > y ) cost = (ll)cnt * y;
	else cost = (ll)(cnt - 1) * x + y;
	cout<<cost<<endl;

	return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
using namespace std;
#define maxn 300020

typedef long long ll;
int n,x,y,cnt,tot;
ll cost;
char a[maxn];

int main(){
	scanf("%d %d %d",&n,&x,&y);
	scanf("%s",a + 1);
	for (int i = 1 ; i <= n ; i++){
		if ( a[i] == '1' ) tot++;
		if ( a[i] == '0' && (a[i - 1] == '1' || i == 1) ) cnt++;
	}
	if ( tot == n ){ printf("0\n"); return 0; }
	if ( x > y ) cost = (ll)cnt * y;
	else cost = (ll)(cnt - 1) * x + y;
	cout<<cost<<endl;
	cout<<cnt<<endl;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;
int n,num;
long long int x,y,shu[3],money;
char a[300010];
bool f[300010];
int main()
{
	scanf("%d%I64d%I64d",&n,&x,&y);
	scanf("%s",&a);
	for (int i=1;i<=n-1;i++) if (a[i-1]!=a[i]) f[++num]=a[i-1]-'0',shu[f[num]]++;
	if (num==0 && a[0]=='1') {printf("0"); return 0;} //特判全是1的情况
	if (num==0 && a[0]=='0') {printf("%d",y); return 0;}
	f[++num]=a[n-1]-'0';
	shu[f[num]]++;
	if (y<x) {printf("%I64d",shu[0]*y); return 0;}  //rigiht
	money=(num/4)*(x+y);
	if (num%4==0) {printf("%I64d",money); return 0;}
	if (num%4==1)
	{
		if (shu[1]>shu[0])
		 {if (((num-1)/2-1)*x+y<money) printf("%I64d",((num-1)/2-1)*x+y);else printf("%I64d",money);}
		 else
		 {if (((num-1)/2)*x+y<money+y) printf("%I64d",((num-1)/2)*x+y);else printf("%I64d",money+y);}
		return 0;
	}
	if (num%4==2)
	{
		if (((num-2)/2)*x+y<money+y) printf("%I64d",((num-2)/2)*x+y);
		 else printf("%I64d",money+y);
		return 0;
	}
	if (num%4==3)
	{
		if (shu[1]>shu[0])
		{if (((num-3)/2)*x+y<money+y) printf("%I64d",((num-3)/2)*x+y);else printf("%I64d",money+y);}
		 else
		{if (((num-3)/2+1)*x+y<money+x+y) printf("%I64d",((num-3)/2+1)*x+y);else printf("%I64d",money+y+x);}
		return 0;
	}
return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;
int n,num;
long long int x,y,shu[3],money;
char a[300010];
bool f[300010];
int main()
{
	scanf("%d%I64d%I64d",&n,&x,&y);
	scanf("%s",&a);
	for (int i=1;i<=n-1;i++) if (a[i-1]!=a[i]) f[++num]=a[i-1]-'0',shu[f[num]]++;
	if (num==0) {printf("0"); return 0;}
	f[++num]=a[n-1]-'0';
	shu[f[num]]++;
	if (y<x) {printf("%I64d",shu[0]*y); return 0;}
	money=(num/4)*(x+y);
	if (num%4==0) {printf("%I64d",money); return 0;}
	if (num%4==1)
	{
		if (shu[1]>shu[0]) printf("%I64d",money);
		 else printf("%I64d",money+y);
		return 0;
	}
	if (num%4==2)
	{
		printf("%I64d",money+y);
		return 0;
	}
	if (num%4==3)
	{
		if (shu[1]>shu[0]) printf("%I64d",money+y);
		 else
		 {
			if (x<y) printf("%I64d",money+x+y);
			 else printf("%I64d",money+2*y);
		 }
		return 0;
	}
return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
using namespace std;
long long int num[3],m,x,y,n;
char a[300010];
int main()
{
	scanf("%I64d%I64d%I64d",&n,&x,&y);
	scanf("%s",&a);
	for (int i=1;i<=strlen(a);i++)
	 if (a[i]!=a[i-1]) num[a[i-1]-'0']++;
	if (!num[0]) {printf("0"); return 0;}
	m=num[0]*y;
	if (a[0]=='1') num[1]--;
    if (a[strlen(a)-1]=='1') num[1]--;
    m=min(m,num[1]*x+y);
    printf("%I64d",m);
return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;
int n,num;
long long int x,y,shu[3],money;
char a[300010];
bool f[300010];
int main()
{
	scanf("%d%I64d%I64d",&n,&x,&y);
	scanf("%s",&a);
	for (int i=1;i<=n-1;i++) if (a[i-1]!=a[i]) f[++num]=a[i-1]-'0',shu[f[num]]++;
	if (num==0) {printf("0"); return 0;} //特判全是1的情况
	f[++num]=a[n-1]-'0';
	shu[f[num]]++;
	if (y<x) {printf("%I64d",shu[0]*y); return 0;}  //rigiht
	money=(num/4)*(x+y);
	if (num%4==0) {printf("%I64d",money); return 0;}
	if (num%4==1)
	{
		if (shu[1]>shu[0])
		 {if (((num-1)/2-1)*x+y<money) printf("%I64d",((num-1)/2-1)*x+y);else printf("%I64d",money);}
		 else
		 {if (((num-1)/2)*x+y<money+y) printf("%I64d",((num-1)/2)*x+y);else printf("%I64d",money+y);}
		return 0;
	}
	if (num%4==2)
	{
		if (((num-2)/2)*x+y<money+y) printf("%I64d",((num-2)/2)*x+y);
		 else printf("%I64d",money+y);
		return 0;
	}
	if (num%4==3)
	{
		if (shu[1]>shu[0])
		{if (((num-3)/2)*x+y<money+y) printf("%I64d",((num-3)/2)*x+y);else printf("%I64d",money+y);}
		 else
		{if (((num-3)/2+1)*x+y<money+x+y) printf("%I64d",((num-3)/2+1)*x+y);else printf("%I64d",money+y+x);}
		return 0;
	}
return 0;
}


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

int main()
{
    long long int n,x,y;
    cin>>n>>x>>y;
    string a;
    cin>>a;
    long long int i = 0,count = 0;
    while(i < n)
    {
        if(a[i] == '0')
        {
            count += 1;
            while(a[i] == '0')
                i++;
        }
        if(a[i] == '1')
        {
            while(a[i] == '1')
                i++;
        }
    }
    i = count*y;
    n = (count-1)*x + y;
    if(i < n)
        cout<<i<<endl;
    else
        cout<<n<<endl;
    return 0;
}


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

int main()
{
    long long int n,x,y;
    cin>>n>>x>>y;
    string a;
    cin>>a;
    long long int i = 0,count = 0;
    while(i < n)
    {
        if(a[i] == '0')
        {
            count += 1;
            while(a[i] == '0')
                i++;
        }
        if(a[i] == '1')
        {
            while(a[i] == '1')
                i++;
        }
    }
    i = count*y;
    if(count > 0)
        n = (count-1)*x + y;
    else
        n = 0;
    if(i < n)
        cout<<i<<endl;
    else
        cout<<n<<endl;
    return 0;
}


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

int main()
{
    int n,x,y;
    cin>>n>>x>>y;
    string a;
    cin>>a;
    int i = 0,count = 0;
    while(i < n)
    {
        if(a[i] == '0')
        {
            count += 1;
            while(a[i] == '0')
                i++;
        }
        if(a[i] == '1')
        {
            while(a[i] == '1')
                i++;
        }
    }
    i = count*y;
    n = (count-1)*x + y;
    if(i < n)
        cout<<i<<endl;
    else
        cout<<n<<endl;
    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <map>
using namespace std;
#define MAXN 300010

char s[MAXN];

int main() {
	int n, x, y;
	scanf("%d %d %d", &n, &x, &y);
	scanf("%s", &s);
	int m = 0; bool last = false;
	for (int i = 0; i < n; i++) {
		if (s[i] == '0') {
			if (!last) {
				last = true;
				m++;
			}
		} else {
			last = false;
		}
	}
//	printf("%d\n", m);
	if (last == 0) {
		printf("%d\n", 0);
	} else {
		printf("%d\n", (m - 1) * min(x, y) + y);
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <map>
using namespace std;
#define MAXN 300010
#define ll long long

char s[MAXN];

int main() {
	int n;
	ll x, y;
	scanf("%d %I64d %I64d", &n, &x, &y);
	scanf("%s", &s);
	int m = 0; bool last = false;
	for (int i = 0; i < n; i++) {
		if (s[i] == '0') {
			if (!last) {
				last = true;
				m++;
			}
		} else {
			last = false;
		}
	}
//	printf("%d\n", m);
	if (m <= 0) {
		printf("%d\n", 0);
	} else {
		printf("%I64d\n", (m - 1) * min(x, y) + y);
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <map>
using namespace std;
#define MAXN 300010

char s[MAXN];

int main() {
	int n, x, y;
	scanf("%d %d %d", &n, &x, &y);
	scanf("%s", &s);
	int m = 0; bool last = false;
	for (int i = 0; i < n; i++) {
		if (s[i] == '0') {
			if (!last) {
				last = true;
				m++;
			}
		} else {
			last = false;
		}
	}
//	printf("%d\n", m);
	if (m <= 0) {
		printf("%d\n", 0);
	} else {
		printf("%d\n", (m - 1) * min(x, y) + y);
	}
	return 0;
}


/*input
7 2 3
1111111
*/
#include <bits/stdc++.h>
using namespace std;

#define pl(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" ";
#define pl2(a,n,m) for(int i=0; i<n; i++){for(int j=0; j<m; j++)cout<<a[i][j]<<" ";cout<<endl;}
#define pc1(x) cout<<x<<" ";
#define pc2(x,y) cout<<x<<" "<<y<<" "<<endl;
#define pc3(x,y,z) cout<<x<<" "<<y<<" "<<z<<" "<<endl;
#define pc4(w,x,y,z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<" "<<endl;
#define pce(x) cout<<x<<endl;
#define ps0() cout<<endl;
#define ps1(x) cout<<#x<<" ";
#define ps2(x,y) cout<<#x<<" "<<y<<" "<<endl;
#define ps3(x,y,z) cout<<#x<<" "<<y<<" "<<z<<" "<<endl;
#define ps4(w,x,y,z) cout<<#w<<" "<<x<<" "#y<<" "<<z<<" "<<endl;
#define pse(x) cout<<#x<<endl;
#define GET_MACRO(_0, _1, _2, _3, _4, NAME, ...) NAME
#define GET_MACRO1(_1, _2, _3, _4, NAME, ...) NAME
#define ps(...) \
		do{if (DEBUG) GET_MACRO(_0, ##__VA_ARGS__, ps4, ps3, ps2, ps1, ps0)(__VA_ARGS__)} while(0);
#define pc(...) \
 		do{if (DEBUG) GET_MACRO1(__VA_ARGS__, pc4, pc3, pc2, pc1)(__VA_ARGS__)} while(0);

#define pb push_back
#define mp make_pair
#define sd(x) scanf("%d",&x);
#define sll(x) scanf("%I64d",&x);
#define F first
#define S second

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define MOD 1000000007
#define e 2.7183

#define DEBUG 1

int main()
{
	int n,a,b;
	scanf("%d %d %d",&n, &a, &b);
	string s;
	cin>>s;

	int p=0;
	for(int i=0; i<n-1; i++)
	{
		if(s[i]=='0' && s[i+1]=='1')
			p++;
	}
	if(s[n-1]=='0')
		p++;

	if(p==0)
	{
		printf("%d", 0);
		return 0;
	}
	int minn = min(a,b);
	ll ans = ll(minn)*(p-1) + b;
	printf("%I64d", ans);

}


/*input
7 2 3
1111111
*/
#include <bits/stdc++.h>
using namespace std;

#define pl(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" ";
#define pl2(a,n,m) for(int i=0; i<n; i++){for(int j=0; j<m; j++)cout<<a[i][j]<<" ";cout<<endl;}
#define pc1(x) cout<<x<<" ";
#define pc2(x,y) cout<<x<<" "<<y<<" "<<endl;
#define pc3(x,y,z) cout<<x<<" "<<y<<" "<<z<<" "<<endl;
#define pc4(w,x,y,z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<" "<<endl;
#define pce(x) cout<<x<<endl;
#define ps0() cout<<endl;
#define ps1(x) cout<<#x<<" ";
#define ps2(x,y) cout<<#x<<" "<<y<<" "<<endl;
#define ps3(x,y,z) cout<<#x<<" "<<y<<" "<<z<<" "<<endl;
#define ps4(w,x,y,z) cout<<#w<<" "<<x<<" "#y<<" "<<z<<" "<<endl;
#define pse(x) cout<<#x<<endl;
#define GET_MACRO(_0, _1, _2, _3, _4, NAME, ...) NAME
#define GET_MACRO1(_1, _2, _3, _4, NAME, ...) NAME
#define ps(...) \
		do{if (DEBUG) GET_MACRO(_0, ##__VA_ARGS__, ps4, ps3, ps2, ps1, ps0)(__VA_ARGS__)} while(0);
#define pc(...) \
 		do{if (DEBUG) GET_MACRO1(__VA_ARGS__, pc4, pc3, pc2, pc1)(__VA_ARGS__)} while(0);

#define pb push_back
#define mp make_pair
#define sd(x) scanf("%d",&x);
#define sll(x) scanf("%I64d",&x);
#define F first
#define S second

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define MOD 1000000007
#define e 2.7183

#define DEBUG 1

int main()
{
	int n,a,b;
	scanf("%d %d %d",&n, &a, &b);
	string s;
	cin>>s;

	int p=0;
	for(int i=0; i<n-1; i++)
	{
		if(s[i]=='0' && s[i+1]=='1')
			p++;
	}
	if(s[n-1]=='0')
		p++;

	if(p==0)
	{
		printf("%d", 0);
		return 0;
	}
	int ans = min(a,b)*(p-1) + b;
	printf("%d", ans);

}


/*input
7 2 3
1111111
*/
#include <bits/stdc++.h>
using namespace std;

#define pl(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" ";
#define pl2(a,n,m) for(int i=0; i<n; i++){for(int j=0; j<m; j++)cout<<a[i][j]<<" ";cout<<endl;}
#define pc1(x) cout<<x<<" ";
#define pc2(x,y) cout<<x<<" "<<y<<" "<<endl;
#define pc3(x,y,z) cout<<x<<" "<<y<<" "<<z<<" "<<endl;
#define pc4(w,x,y,z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<" "<<endl;
#define pce(x) cout<<x<<endl;
#define ps0() cout<<endl;
#define ps1(x) cout<<#x<<" ";
#define ps2(x,y) cout<<#x<<" "<<y<<" "<<endl;
#define ps3(x,y,z) cout<<#x<<" "<<y<<" "<<z<<" "<<endl;
#define ps4(w,x,y,z) cout<<#w<<" "<<x<<" "#y<<" "<<z<<" "<<endl;
#define pse(x) cout<<#x<<endl;
#define GET_MACRO(_0, _1, _2, _3, _4, NAME, ...) NAME
#define GET_MACRO1(_1, _2, _3, _4, NAME, ...) NAME
#define ps(...) \
		do{if (DEBUG) GET_MACRO(_0, ##__VA_ARGS__, ps4, ps3, ps2, ps1, ps0)(__VA_ARGS__)} while(0);
#define pc(...) \
 		do{if (DEBUG) GET_MACRO1(__VA_ARGS__, pc4, pc3, pc2, pc1)(__VA_ARGS__)} while(0);

#define pb push_back
#define mp make_pair
#define sd(x) scanf("%d",&x);
#define sll(x) scanf("%I64d",&x);
#define F first
#define S second

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define MOD 1000000007
#define e 2.7183

#define DEBUG 1

int main()
{
	int n,a,b;
	scanf("%d %d %d",&n, &a, &b);
	string s;
	cin>>s;

	int p=0;
	for(int i=0; i<n-1; i++)
	{
		if(s[i]=='0' && s[i+1]=='1')
			p++;
	}
	if(s[n-1]=='0')
		p++;

	if(p==0)
	{
		printf("%d", 0);
		return 0;
	}
	int minn = min(a,b);
	ll ans = minn*(p-1) + b;
	printf("%I64d", ans);

}


#include<algorithm>
#include<clocale>
#include<cmath>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<iostream>
#include<istream>
#include<map>
#include<math.h>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<string>
#include<vector>
using namespace std;
long long n,x,y,num,ans=1e18;
char a[300010];
int main(){
	cin>>n>>x>>y;
	for (int i=0;i<n;i++) cin>>a[i];
	for (int i=0;i<n;i++)
		if (a[i]=='0'){
			num+=1;
			for (;i<n;i++) if (a[i]=='1') break;
		}
	for (int i=0;i<num;i++) ans=min(ans,x*i+y*(num-i));
	if (ans!=1e18)
		cout<<ans<<endl;
	else
		cout<<0<<endl;
	return 0;
}


#include<algorithm>
#include<clocale>
#include<cmath>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<iostream>
#include<istream>
#include<map>
#include<math.h>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<string>
#include<vector>
using namespace std;
int n,x,y,ans;
char a[300010];
int main(){
	cin>>n>>x>>y;
	for (int i=0;i<n;i++) cin>>a[i];
	for (int i=0;i<n;i++)
		if (a[i]=='0'){
			ans+=1;
			for (;i<n;i++) if (a[i]=='1') break;
		}
	if ((ans-1)*x+y<=y*ans) ans=(ans-1)*x+y;
	if (y<x) ans*=y;
	cout<<ans<<endl;
	return 0;
}


#include<algorithm>
#include<clocale>
#include<cmath>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<iostream>
#include<istream>
#include<map>
#include<math.h>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<string>
#include<vector>
using namespace std;
int n,x,y,num,ans=1e9;
char a[300010];
int main(){
	cin>>n>>x>>y;
	for (int i=0;i<n;i++) cin>>a[i];
	for (int i=0;i<n;i++)
		if (a[i]=='0'){
			num+=1;
			for (;i<n;i++) if (a[i]=='1') break;
		}
	for (int i=0;i<num;i++) ans=min(ans,x*i+y*(num-i));
	if (an1!=1000000000)
		cout<<ans<<endl;
	else
		cout<<0<<endl;
	return 0;
}


#include<algorithm>
#include<clocale>
#include<cmath>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<iostream>
#include<istream>
#include<map>
#include<math.h>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<string>
#include<vector>
using namespace std;
int n,x,y,num,ans=1e9;
char a[300010];
int main(){
	cin>>n>>x>>y;
	for (int i=0;i<n;i++) cin>>a[i];
	for (int i=0;i<n;i++)
		if (a[i]=='0'){
			num+=1;
			for (;i<n;i++) if (a[i]=='1') break;
		}
	for (int i=0;i<num;i++) ans=min(ans,x*i+y*(num-i));
	cout<<ans<<endl;
	return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int a,x,y;
    cin >> a >> x >> y;

    string s;
    cin >> s;

    string s2 = "";

    s2 += s[0];

    for (int i=1; i<s.size(); i++)
        if (s[i] != s[i-1]) s2 += s[i];

    int n = 0;

    for (int i=0; i<s2.size(); i++)
        if (s2[i] == '0') n++;

    //cout << "s2 = "<<s2<<endl;
    //cout << "n = "<<n<<endl;

    long long eden_nacin = (long long) (n-1)*x + y;
    long long drug_nacin = (long long) n*y;

    cout << min(eden_nacin, drug_nacin);
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int a,x,y;
    cin >> a >> x >> y;

    string s;
    cin >> s;

    string s2 = "";

    s2 += s[0];

    for (int i=1; i<s.size(); i++)
        if (s[i] != s[i-1]) s2 += s[i];

    int n = 0;

    for (int i=0; i<s2.size(); i++)
        if (s2[i] == '0') n++;

    //cout << "s2 = "<<s2<<endl;
    //cout << "n = "<<n<<endl;

    long long najarno = 999999999999999;

    for (int i=0; i<n; i++)
    {
        najarno = min(najarno, (long long) (n-i)*y + i*x);
    }

    cout << najarno;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int a,x,y;
    cin >> a >> x >> y;

    string s;
    cin >> s;

    string s2 = "";

    s2 += s[0];

    for (int i=1; i<s.size(); i++)
        if (s[i] != s[i-1]) s2 += s[i];

    int n = 0;

    for (int i=0; i<s2.size(); i++)
        if (s2[i] == '0') n++;

    //cout << "s2 = "<<s2<<endl;
    //cout << "n = "<<n<<endl;

    long long najarno = 999999999999999;

    for (int i=0; i<n; i++)
    {
        najarno = min(najarno, (long long) (n-i)*y + i*x);
    }

    if (najarno == 999999999999999)
        cout << 0;
    else
        cout << najarno;
    return 0;
}


#include <algorithm>
#include <cstring>
#include <cstdio>

int x[300005];
char s[300005];

int main(){
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	scanf("%s",s+1);
	x[1]=s[1]-48;
	int l=1;
	for (int i=2;i<=n;i++) if (s[i]!=s[i-1]) x[++l]=s[i]-48;
	int p=l>>1;
	if (!x[1]) p++;
	long long ans=p*1ll*b;
	if (ans>b+(p-1)*1ll*a) ans=b+(p-1)*1ll*a;
	printf("%lld",ans);
}


#include <algorithm>
#include <cstring>
#include <cstdio>

int x[300005];
char s[300005];

int main(){
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	scanf("%s",s+1);
	x[1]=s[1]-48;
	int l=1;
	for (int i=2;i<=n;i++) if (s[i]!=s[i-1]) x[++l]=s[i]-48;
	if (!x[1]) l++;
	int p=l>>1;
	long long ans=p*1ll*b;
	if (ans>b+(p-1)*1ll*a&&p>1) ans=b+(p-1)*1ll*a;
	printf("%lld",ans);
}


#include <algorithm>
#include <cstring>
#include <cstdio>

int x[300005];
char s[300005];

int main(){
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	scanf("%s",s+1);
	x[1]=s[1]-48;
	int l=1;
	for (int i=2;i<=n;i++) if (s[i]!=s[i-1]) x[++l]=s[i]-48;
	int p=l>>1;
	if (!x[1]) p++;
	int ans=p*b;
	if (ans>b+(p-1)*a) ans=b+(p-1)*a;
	printf("%d",ans);
}


#include <algorithm>
#include <cstring>
#include <cstdio>

int x[300005];
char s[300005];

int main(){
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	scanf("%s",s+1);
	x[1]=s[1]-48;
	int l=1;
	for (int i=2;i<=n;i++) if (s[i]!=s[i-1]) x[++l]=s[i]-48;
	if (!x[1]) l++;
	int p=l>>1;
	long long ans=p*1ll*b;
	if (ans>b+(p-1)*1ll*a) ans=b+(p-1)*1ll*a;
	printf("%lld",ans);
}


#include"bits/stdc++.h"
using namespace std;
int n,x,y;
char c[1000050];
int main()
{
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++)
	{
		cin>>c[i];
	}
	c[n+1]='k';
	int zero=0;
	int one=0;
	for(int i=1;i<=n;i++)
	{
		if(c[i-1]!=c[i])
		{
			if(c[i]=='0') zero++;
			else one++;
		}
	}
	if(zero==0) cout<<"0";
	long long l=(zero-1)*min(x,y)+y;
	else cout<<ll;
}


#include"bits/stdc++.h"
using namespace std;
int n,x,y;
char c[310050];
int main()
{
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++)
	{
		cin>>c[i];
	}
	c[0]='k';
	c[n+1]='k';
	int zero=0;
	int one=0;
	for(int i=1;i<=n;i++)
	{
		if(c[i-1]!=c[i])
		{
			if(c[i]=='0') zero++;
			else one++;
		}
	}
	if(zero==0) cout<<"0";
	else
	{
		long long k=min(x,y);
		long long w=zero-1;
		long long l=k*w+y;
		cout<<l;
	}
}


#include"bits/stdc++.h"
using namespace std;
int n,x,y;
char c[300050];
int main()
{
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++)
	{
		cin>>c[i];
	}
	c[0]='k';
	c[n+1]='k';
	int zero=0;
	int one=0;
	for(int i=1;i<=n;i++)
	{
		if(c[i-1]!=c[i])
		{
			if(c[i]=='0') zero++;
			else one++;
		}
	}
	if(zero==0) cout<<"0";
	else
	{
		long long l=(zero-1)*min(x,y)+y;
		cout<<l;
	}
}


#include"bits/stdc++.h"
using namespace std;
int n,x,y;
char c[1000050];
int main()
{
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++)
	{
		cin>>c[i];
	}
	c[n+1]='k';
	int zero=0;
	int one=0;
	for(int i=1;i<=n;i++)
	{
		if(c[i-1]!=c[i])
		{
			if(c[i]=='0') zero++;
			else one++;
		}
	}
	if(zero==0) cout<<"0";
	else cout<<(zero-1)*min(x,y)+y;
}


#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
#define INF 1e15+7
#define ll long long
#define tam 200
#define MOD 998244353
#define sqrtcomp 750

int main()
{
  ll n,x,y;
  string txt;
  cin>>n>>x>>y;
  cin>>txt;
  deque<ll> cola;
  for (ll i = 1; i < txt.size(); ++i)
  {
    if (txt[i]!=txt[i-1])
      {
        if (cola.size()==1)
        cola.push_back(1);
        cola.push_back(1);
      }

  }
  if (cola.size()==0)
    cola.push_back(1);
  ll minn=INF;
  ll totahora=0,num;
  if (txt[0]=='1')
    {
      num=cola.size()/2;
      minn=min(totahora+num*y,minn);
    }
    else
    {
      num=cola.size()/2+cola.size()%2;
      minn=min(totahora+num*y,minn);
    }
  while(cola.size()>2)
  {
    totahora+=x;
    ll auxnum=cola.front();
    cola.pop_front();
    cola.pop_front();
    if (cola.size()<4)
    {
      cola.push_back(1);
    }
    if (txt[0]==1)
    {
      num=cola.size()/2;
      minn=min(totahora+num*y,minn);
    }
    else
    {
      num=cola.size()/2+cola.size()%2;
      minn=min(totahora+num*y,minn);
    }
  }
  cout<<minn<<endl;
}


#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
#define INF 1e15+7
#define ll long long
#define tam 200
#define MOD 998244353
#define sqrtcomp 750

int main()
{
  ll n,x,y;
  string txt;
  cin>>n>>x>>y;
  cin>>txt;
  deque<ll> cola;
  cola.push_back(1);
  for (ll i = 1; i < txt.size(); ++i)
  {
    if (txt[i]!=txt[i-1])
      {

        cola.push_back(1);
      }

  }

  ll minn=INF;
  ll totahora=0,num;
  //cout<<cola.size()<<endl;

    if (txt[0]=='1')
    {
      num=cola.size()/2;
      minn=min(totahora+num*y,minn);
    }
    else
    {
      num=cola.size()/2+cola.size()%2;
      minn=min(totahora+num*y,minn);
    }

  while(cola.size()>2)
  {
    totahora+=x;
    ll auxnum=cola.front();
    cola.pop_front();
    cola.pop_front();
    if (cola.size()<4)
    {
      cola.push_back(1);
    }
    if (txt[0]==1)
    {
      num=cola.size()/2;
      minn=min(totahora+num*y,minn);
    }
    else
    {
      num=cola.size()/2+cola.size()%2;
      minn=min(totahora+num*y,minn);
    }
  }
  if (cola.size()==2)
  {
    minn=min(totahora+y,minn);
  }
  cout<<minn<<endl;
}


#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
#define INF 1e18+7
#define ll long long
#define tam 200
#define MOD 998244353
#define sqrtcomp 750

int main()
{
  ll n,x,y;
  string txt;
  cin>>n>>x>>y;
  cin>>txt;
  deque<ll> cola;
  cola.push_back(1);
  for (ll i = 1; i < txt.size(); ++i)
  {
    if (txt[i]!=txt[i-1])
      {

        cola.push_back(1);
      }

  }

  ll minn=1e18+7;
  ll totahora=0,num;
  //cout<<cola.size()<<endl;

    if (txt[0]=='1')
    {
      num=cola.size()/2;
      minn=min(totahora+num*y,minn);
    }
    else
    {
      num=cola.size()/2+cola.size()%2;
      minn=min(totahora+num*y,minn);
    }

  while(cola.size()>2)
  {
    totahora+=x;
    ll auxnum=cola.front();
    if (cola.size()<4)
    {
      cola.push_back(1);
    }
    cola.pop_front();
    cola.pop_front();
    if (txt[0]=='1')
    {
      num=cola.size()/2;
      minn=min(totahora+num*y,minn);
    }
    else
    {
      num=cola.size()/2+cola.size()%2;
      minn=min(totahora+num*y,minn);
    }
  }
  //cout<<totahora<<" ";
  if (cola.size()==2)
  {
    minn=min(totahora+y,minn);
  }
  cout<<minn<<endl;
}


#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
#define INF 1e18+7
#define ll long long
#define tam 200
#define MOD 998244353
#define sqrtcomp 750

int main()
{
  ll n,x,y;
  string txt;
  cin>>n>>x>>y;
  cin>>txt;
  deque<ll> cola;
  cola.push_back(1);
  for (ll i = 1; i < txt.size(); ++i)
  {
    if (txt[i]!=txt[i-1])
      {

        cola.push_back(1);
      }

  }

  ll minn=1e18+7;
  ll totahora=0,num;
  //cout<<cola.size()<<endl;

    if (txt[0]=='1')
    {
      num=cola.size()/2;
      minn=min(totahora+num*y,minn);
    }
    else
    {
      num=cola.size()/2+cola.size()%2;
      minn=min(totahora+num*y,minn);
    }

  while(cola.size()>2)
  {
    totahora+=x;
    ll auxnum=cola.front();
    cola.pop_front();
    cola.pop_front();
    if (cola.size()<4)
    {
      cola.push_back(1);
    }
    if (txt[0]==1)
    {
      num=cola.size()/2;
      minn=min(totahora+num*y,minn);
    }
    else
    {
      num=cola.size()/2+cola.size()%2;
      minn=min(totahora+num*y,minn);
    }
  }
  if (cola.size()==2)
  {
    minn=min(totahora+y,minn);
  }
  cout<<minn<<endl;
}