#10WA了,不知道哪里错了,求调
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
char now,last;
int n,a,b,ans=0;
bool ay=1,by=1;
cin>>n>>a>>b;
for(int i=0;i<n;i++)
{
cin>>now;
if(last=='A') ay=0;
else if(last=='B') by=0;
else if(last=='.' || last=='*') ay=1,by=1;
if(a<=0) ay=0;
if(b<=0) by=0;
if(now=='.')
{
if(ay && !by) a--,ans++, ay=0,by=1, now='A';
else if(by && !ay) b--,ans++, by=0,ay=1, now='B';
else if(ay && by)
{
if(a>b) a--,ans++, ay=0,by=1, now='A';
else if(b>a) b--,ans++, by=0,ay=1, now='B';
else a--,ans++, ay=0,by=1, now='A';
}
}
last=now;
cout<<now<<" "<<last<<" "<<ay<<" "<<by<<" "<<a<<" "<<b<<" "<<ans<<endl;
}
cout<<ans;
return 0;
}