#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> //for using as set with indexing
//using namespace __gnu_pbds;     //auto x = s.find_by_order(2);  s.order_of_key(7)->returns pos of 7 else expected one if exits

#define IOS ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define deb(x) cout << #x << " " << x << endl;
#define fi(i,a,b) for(long long int i = a; i<b; i++)
#define fd(i,a,b) for(long long int i = a; i>=b; i--)
#define ll long long int
#define pii pair<int, int>
#define vi vector<int>
#define N 1000000007
#define endl "\n"
#define pq priority queue
#define pb push_back
#define pf push_front
#define mt make_tuple
#define mp make_pair
#define present(container, element) (container.find(element) != container.end())
#define cpresent(container, element) (find(all(container),element) != container.end())
#define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()

#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define prec(a) fixed<<setprecision(9)<<a
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
//const long double PI = (long double)(3.1415926535897932384626433832795);

#define MAXN   100001
using namespace std;

//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//*****************************

int spf[MAXN];

void solve()
{
	ll n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	ll y = 0;
	fi(i, 0, s.length())
	{
		if (s[i] == '.')
		{
			y++;
		}

	}
	ll prev = 0, cur = 0;
	vector<ll> sec;
	fi(i, 0, s.length())
	{
		if (s[i] == '*')
		{
			sec.pb(i + 1 - prev - 1);
			cout << i + 1 - prev - 1 << " ";
			prev = i + 1;
		}
		if (i == s.length() - 1)
		{
			cur = n + 1;
			sec.pb(cur - prev - 1);
			cout << cur - prev - 1 << " ";

		}

	}
	ll z = 0, exc = 0;
	fi(i, 0, sec.size())
	{
		if (sec[i] == 1)
		{
			z++;
		}
		else
		{
			if (sec[i] % 2 == 1)
			{
				exc += sec[i] / 2 + 1;

			}
			else
			{
				exc += sec[i] / 2;
			}
		}

	}
	cout << "\n";
	ll x = 0;
	fi(i, 0, sec.size())
	{
		if (sec[i] % 2 == 1)
		{
			x += sec[i] / 2 + 1;

		}
		else
		{
			x += sec[i] / 2;
		}

	}
	cout << x << " " << y << "\n";

	ll n_x = min(min(a, b), x);
	ll h = 0;
	ll n_y;
	if (n_x - exc > 0)
	{
		h = n_x - exc;
	}
	if (z - h > 0)
	{

		n_y = min(max(a, b), y - x + z - h);
		cout << n_x + n_y << "\n";

	}
	else
	{
		n_y = min(max(a, b), y - x);
		cout << n_x + n_y << "\n";

	}

}

int main()
{

// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	IOS;
	int t = 1;
	//cin >> t;
	while (t--) {solve();}
	return 0 ;
}

/*
ll fast_exp(int base, int exp) {
    ll res=1;
    while(exp>0) {
       if(exp%2==1) res=(res*base)%MOD;
       base=(base*base)%MOD;
       exp/=2;
    }
    return res%MOD;
}
*/

/*
void sieve()
{
    spf[1] = 1;
    for (int i=2; i<MAXN; i++)
        spf[i] = i;
    for (int i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (int i=3; i*i<MAXN; i++)
    {
        if (spf[i] == i)
        {

            for (int j=i*i; j<MAXN; j+=i)

                if (spf[j]==j)
                    spf[j] = i;
        }
    }
}

vector<int> fac(int x)
{
    vector<int> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> //for using as set with indexing
//using namespace __gnu_pbds;     //auto x = s.find_by_order(2);  s.order_of_key(7)->returns pos of 7 else expected one if exits

#define IOS ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define deb(x) cout << #x << " " << x << endl;
#define fi(i,a,b) for(long long int i = a; i<b; i++)
#define fd(i,a,b) for(long long int i = a; i>=b; i--)
#define ll long long int
#define pii pair<int, int>
#define vi vector<int>
#define N 1000000007
#define endl "\n"
#define pq priority queue
#define pb push_back
#define pf push_front
#define mt make_tuple
#define mp make_pair
#define present(container, element) (container.find(element) != container.end())
#define cpresent(container, element) (find(all(container),element) != container.end())
#define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()

#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define prec(a) fixed<<setprecision(9)<<a
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
//const long double PI = (long double)(3.1415926535897932384626433832795);

#define MAXN   100001
using namespace std;

//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//*****************************

int spf[MAXN];

void solve()
{
	ll n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	ll y = 0;
	fi(i, 0, s.length())
	{
		if (s[i] == '.')
		{
			y++;
		}

	}
	ll prev = 0, cur = 0;
	vector<ll> sec;
	fi(i, 0, s.length())
	{
		if (s[i] == '*')
		{
			sec.pb(i + 1 - prev - 1);
			//cout << i + 1 - prev - 1 << " ";
			prev = i + 1;
		}
		if (i == s.length() - 1)
		{
			cur = n + 1;
			sec.pb(cur - prev - 1);
			//cout << cur - prev - 1 << " ";

		}

	}
	ll z = 0, exc = 0;
	fi(i, 0, sec.size())
	{
		if (sec[i] == 1)
		{
			z++;
		}
		else
		{
			if (sec[i] % 2 == 1)
			{
				exc += sec[i] / 2 + 1;

			}
			else
			{
				exc += sec[i] / 2;
			}
		}

	}
	//cout << "\n";
	ll x = 0;
	fi(i, 0, sec.size())
	{
		if (sec[i] % 2 == 1)
		{
			x += sec[i] / 2 + 1;

		}
		else
		{
			x += sec[i] / 2;
		}

	}
	//cout << x << " " << y << "\n";

	ll n_x = min(max(a, b), x);
	ll h = 0;
	ll n_y;
	if (n_x - exc > 0)
	{
		h = n_x - exc;
	}
	if (z - h > 0)
	{

		n_y = min(min(a, b), y - x + z - h);
		cout << n_x + n_y << "\n";

	}
	else
	{
		n_y = min(min(a, b), y - x);
		cout << n_x + n_y << "\n";

	}

}

int main()
{

// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	IOS;
	int t = 1;
	//cin >> t;
	while (t--) {solve();}
	return 0 ;
}

/*
ll fast_exp(int base, int exp) {
    ll res=1;
    while(exp>0) {
       if(exp%2==1) res=(res*base)%MOD;
       base=(base*base)%MOD;
       exp/=2;
    }
    return res%MOD;
}
*/

/*
void sieve()
{
    spf[1] = 1;
    for (int i=2; i<MAXN; i++)
        spf[i] = i;
    for (int i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (int i=3; i*i<MAXN; i++)
    {
        if (spf[i] == i)
        {

            for (int j=i*i; j<MAXN; j+=i)

                if (spf[j]==j)
                    spf[j] = i;
        }
    }
}

vector<int> fac(int x)
{
    vector<int> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */


#define push_back pb
#define make_pair mk
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
#include<cmath>
#include<map>
#include<algorithm>
#include<string>
#include<string.h>
#include<set>
#include<queue>
#include<stack>
using std::pair;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,int>PII;
const double PI=acos(-1);
const int maxn = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const int mod =1e9+7;
const ll inf =1e18;
using namespace std;
int main()
{
    int n,a,b;
    string s;
    cin>>n>>a>>b;
    cin>>s;
    int res=0;
    int pre;
    pre=0;
    for(int i=1;i<=n;i++)
    {
        if(s[i-1]=='.')
        {
            if(pre==1)
            {
                if(b!=0)
                {
                    b--;
                    res++;
                    pre=2;
                }
            }
            else if(pre==2)
            {
                if(a!=0)
                {
                    a--;
                    res++;
                    pre=1;
                }
            }
            else
            {
                if(a>b&&a)
                {
                    a--;
                    pre=1;
                    res++;
                }
                else if(a<=b&&b)
                {
                    b--;
                    pre=2;
                    res++;
                }
            }
        }
        else
            pre=0;
    }
    cout<<res<<endl;
}


#define push_back pb
#define make_pair mk
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
#include<cmath>
#include<map>
#include<algorithm>
#include<string>
#include<string.h>
#include<set>
#include<queue>
#include<stack>
using std::pair;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,int>PII;
const double PI=acos(-1);
const int maxn = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const int mod =1e9+7;
const ll inf =1e18;
using namespace std;
int main()
{
    int n,a,b;
    string s;
    cin>>n>>a>>b;
    cin>>s;
    int res=0;
    int pre;
    pre=0;
    for(int i=1;i<=n;i++)
    {
        if(s[i-1]=='.')
        {
            if(pre==1)
            {
                if(b!=0)
                {
                    b--;
                    res++;
                    pre=2;
                }
                else pre=0;
            }
            else if(pre==2)
            {
                if(a!=0)
                {
                    a--;
                    res++;
                    pre=1;
                }
                else pre=0;
            }
            else
            {
                if(a>b&&a)
                {
                    a--;
                    pre=1;
                    res++;
                }
                else if(a<=b&&b)
                {
                    b--;
                    pre=2;
                    res++;
                }

            }
        }
        else
            pre=0;
    }
    cout<<res<<endl;
}


#define push_back pb
#define make_pair mk
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
#include<cmath>
#include<map>
#include<algorithm>
#include<string>
#include<string.h>
#include<set>
#include<queue>
#include<stack>
using std::pair;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,int>PII;
const double PI=acos(-1);
const int maxn = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const int mod =1e9+7;
const ll inf =1e18;
using namespace std;
int main()
{
    int n,a,b;
    string s;
    cin>>n>>a>>b;
    cin>>s;
    int res=0;
    int pre;
    if(a>b) pre=1 ;
    else pre=2;
    for(int i=1;i<=n;i++)
    {
        if(s[i-1]=='.')
        {
            if(pre==1)
            {
                if(b!=0)
                {
                    b--;
                    res++;
                    pre=2;
                }
            }
            else if(pre==2)
            {
                if(a!=0)
                {
                    a--;
                    res++;
                    pre=1;
                }
            }
            else
            {
                if(a>b)
                {
                    a--;
                    pre=1;
                    res++;
                }
                else
                {
                    b--;
                    pre=2;
                    res++;
                }
            }
        }
        else
            pre=0;
    }
    cout<<res<<endl;
}


#define push_back pb
#define make_pair mk
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
#include<cmath>
#include<map>
#include<algorithm>
#include<string>
#include<string.h>
#include<set>
#include<queue>
#include<stack>
using std::pair;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,int>PII;
const double PI=acos(-1);
const int maxn = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const int mod =1e9+7;
const ll inf =1e18;
using namespace std;
int main()
{
    int n,a,b;
    string s;
    cin>>n>>a>>b;
    cin>>s;
    int res=0;
    int pre;
    if(a>b) pre=2 ;
    else pre=1;
    for(int i=1;i<=n;i++)
    {
        if(s[i-1]=='.')
        {
            if(pre==1)
            {
                if(b!=0)
                {
                    b--;
                    res++;
                    pre=2;
                }
            }
            else if(pre==2)
            {
                if(a!=0)
                {
                    a--;
                    res++;
                    pre=1;
                }
            }
            else
            {
                if(a>b&&a)
                {
                    a--;
                    pre=1;
                    res++;
                }
                else if(a<=b&&b)
                {
                    b--;
                    pre=2;
                    res++;
                }
            }
        }
        else
            pre=0;
    }
    cout<<res<<endl;
}


#define push_back pb
#define make_pair mk
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
#include<cmath>
#include<map>
#include<algorithm>
#include<string>
#include<string.h>
#include<set>
#include<queue>
#include<stack>
using std::pair;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,int>PII;
const double PI=acos(-1);
const int maxn = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const int mod =1e9+7;
const ll inf =1e18;
using namespace std;
int main()
{
    int n,a,b;
    string s;
    cin>>n>>a>>b;
    cin>>s;
    int res=0;
    int pre;
    pre=0;
    for(int i=1;i<=n;i++)
    {
        if(s[i-1]=='.')
        {
            if(pre==1)
            {
                if(b!=0)
                {
                    b--;
                    res++;
                    pre=1;
                }
            }
            else if(pre==2)
            {
                if(a!=0)
                {
                    a--;
                    res++;
                    pre=2;
                }
            }
            else
            {
                if(a>b&&a)
                {
                    a--;
                    pre=1;
                    res++;
                }
                else if(a<=b&&b)
                {
                    b--;
                    pre=2;
                    res++;
                }
            }
        }
        else
            pre=0;
    }
    cout<<res<<endl;
}


#define push_back pb
#define make_pair mk
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
#include<cmath>
#include<map>
#include<algorithm>
#include<string>
#include<string.h>
#include<set>
#include<queue>
#include<stack>
using std::pair;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,int>PII;
const double PI=acos(-1);
const int maxn = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const int mod =1e9+7;
const ll inf =1e18;
using namespace std;
int main()
{
    int n,a,b;
    string s;
    cin>>n>>a>>b;
    cin>>s;
    int res=0;
    int pre;
    if(a>b) pre=1 ;
    else pre=2;
    for(int i=1;i<=n;i++)
    {
        if(s[i-1]=='.')
        {
            if(pre==1)
            {
                if(b!=0)
                {
                    b--;
                    res++;
                    pre=2;
                }
            }
            else if(pre==2)
            {
                if(a!=0)
                {
                    a--;
                    res++;
                    pre=1;
                }
            }
            else
            {
                if(a>b&&a)
                {
                    a--;
                    pre=1;
                    res++;
                }
                else if(a<=b&&b)
                {
                    b--;
                    pre=2;
                    res++;
                }
            }
        }
        else
            pre=0;
    }
    cout<<res<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,n,x,i=0,k=0,m;
cin>>n>>a>>b;
string t;
cin>>t;
string s='*'+t;
int d=a;
int f=b;
for (i=0;i<=n;i++){
	if(s[i]=='*')
		{k=0;
	    for(m=i+1;m<=n;m++)
	    {if(s[m]=='*')
	        break;
	     else
	     	k++;
		}
		if(a>=b)
			{b=b-k/2;
			 a=a-(k+1)/2;
			 if(a<=0&&b<=0)
			 	{int p=d+f;cout<<p;
			 	return 0;
				 }
			}
		else{
			a=a-k/2;
			b=b-(k+1)/2;
			if(a<=0&&b<=0)
			 	{
				 int p=d+f;cout<<p;
			 	return 0;}
		}

i=m;
}

}
long long p=d+f-a-b;cout<<p;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,n,x,i=0,k=0,m;
cin>>n>>a>>b;
string s;
cin>>s;
int d=a;
int f=b;
for (i=0;i<n;i++){
	if(s[i]=='*'||i==0)
		{k=0;
	    for(m=i+1;m<n;m++)
	    {if(s[m]=='*')
	        break;
	     else
	     	k++;
		}
		if(a>=b)
			{b=b-k/2;
			 a=a-(k+1)/2;
			 if(a<=0&&b<=0)
			 	return d+f;
			}
		else{
			a=a-k/2;
			b=b-(k+1)/2;
			if(a<=0&&b<=0)
			 	return d+f;

		}

}

}
return d-a+f-b;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,n,x,i=0,k=0,m;
cin>>n>>a>>b;
string s;
cin>>s;
int d=a;
int f=b;
for (i=0;i<n;i++){
	if(s[i]=='*'||i==0)
		{k=0;if(i==0)k=1;
	    for(m=i+1;m<n;m++)
	    {if(s[m]=='*')
	        break;
	     else
	     	k++;
		}
		if(a>=b)
			{b=b-k/2;
			 a=a-(k+1)/2;
			 if(a<=0&&b<=0)
			 	{int p=d+f;cout<<p;
			 	return 0;
				 }
			}
		else{
			a=a-k/2;
			b=b-(k+1)/2;
			if(a<=0&&b<=0)
			 	{
				 int p=d+f;cout<<p;
			 	return 0;}
		}

}

}
int p=d+f-a-b;cout<<p;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,n,x,i=0,k=0,m;
cin>>n>>a>>b;
string t;
cin>>t;
string s='*'+t;
int d=a;
int f=b;
for (i=0;i<=n;i++){
	if(s[i]=='*')
		{k=0;
	    for(m=i+1;m<=n;m++)
	    {if(s[m]=='*')
	        break;
	     else
	     	k++;
		}
		if(a>=b)
			{b=b-k/2;
			 a=a-(k+1)/2;
			 if(a<=0&&b<=0)
			 	{int p=d+f;cout<<p;
			 	return 0;
				 }
			}
		else{
			a=a-k/2;
			b=b-(k+1)/2;
			if(a<=0&&b<=0)
			 	{
				 int p=d+f;cout<<p;
			 	return 0;}
		}

}

}
long long p=d+f-a-b;cout<<p;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,n,x,i=0,k=0,m;
cin>>n>>a>>b;
string t;
cin>>t;
string s='*'+t;
int d=a;
int f=b;
for (i=0;i<=n;i++){
	if(s[i]=='*')
		{k=0;
	    for(m=i+1;m<=n;m++)
	    {if(s[m]=='*')
	        break;
	     else
	     	k++;
		}
		if(a>=b)
			{b=b-k/2;
			 a=a-(k+1)/2;
			 if(a<=0&&b<=0)
			 	{int p=d+f;cout<<p;
			 	return 0;
				 }
			}
		else{
			a=a-k/2;
			b=b-(k+1)/2;
			if(a<=0&&b<=0)
			 	{
				 int p=d+f;cout<<p;
			 	return 0;}
		}

}

}
if(a<=0)a=0;
if(b<=0)b=0;
long long p=d+f-a-b;cout<<p;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,n,x,i=0,k=0,m;
cin>>n>>a>>b;
string t;
cin>>t;
string s='*'+t;
int d=a;
int f=b;
for (i=0;i<=n;i++){
	if(s[i]=='*')
		{k=0;
	    for(m=i+1;m<=n;m++)
	    {if(s[m]=='*')
	        break;
	     else
	     	k++;
		}
		if(a>=b)
			{b=b-k/2;
			 a=a-(k+1)/2;
			 if(a<=0&&b<=0)
			 	{int p=d+f;cout<<p;
			 	return 0;
				 }
			}
		else{
			a=a-k/2;
			b=b-(k+1)/2;
			if(a<=0&&b<=0)
			 	{
				 int p=d+f;cout<<p;
			 	return 0;}
		}

}

}
int p=d+f-a-b;cout<<p;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,n,x,i=0,k=0,m;
cin>>n>>a>>b;
string t;
cin>>t;
string s='*'+t;
int d=a;
int f=b;
for (i=0;i<=n;i++){
	if(s[i]=='*')
		{k=0;
	    for(m=i+1;m<=n;m++)
	    {if(s[m]=='*')
	        break;
	     else
	     	k++;
		}
		if(a>=b)
			{b=b-k/2;
			 a=a-(k+1)/2;
			 if(a<=0&&b<=0)
			 	{int p=d+f;cout<<p;
			 	return 0;
				 }
			}
		else{
			a=a-k/2;
			b=b-(k+1)/2;
			if(a<=0&&b<=0)
			 	{
				 int p=d+f;cout<<p;
			 	return 0;}
		}

}
i=m;
}
long long p=d+f-a-b;cout<<p;
}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }

    ll ans = 0;
    for(auto v : l) {
        if(a > b) {
            swap(a,b);
        }

        ll c,d;
        if(v % 2) {
            c = v / 2;
            d = (v + 1) / 2;
        }else{
            c = d = v / 2;
        }

        cou += min(c,a);
        a -= min(c,a);
        if(a < 1) {
            cou += min(min(a + 1,b),d);
            b -= min(min(a + 1,b),d);
        }else {
            cou += min(d,b);
            b -= min(d,b);
        }
    }
    cout << cou << endl;
    return 0;

}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }
    if(cou > 0)
        l.pb(cou);
    sort(l.begin(),l.end(),std::greater<ll>());

    cou = 0;
    for(auto v : l) {
        if(a > b) {
            swap(a,b);
        }

        ll c,d;
        if(v % 2) {
            c = v / 2;
            d = (v + 1) / 2;
        }else{
            c = d = v / 2;
        }

        cou += min(c,a);
        ll sa = min(c,a);
        a -= min(c,a);
        if(a < 1) {
            cou += min(min(sa + 1,b),d);
            b -= min(min(sa + 1,b),d);
        }else {
            cou += min(d,b);
            b -= min(d,b);
        }
    }
    cout << cou << endl;
    return 0;

}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }

    ll ans = 0;
    for(auto v : l) {
        if(a > b) {
            swap(a,b);
        }

        ll c,d;
        if(v % 2) {
            c = v / 2;
            d = (v + 1) / 2;
        }else{
            c = d = v / 2;
        }

        cou += min(c,a);
        a -= min(c,a);
        if(a < 1) {
            cou += min(min(a + 1,b),d);
            break;
        }
        cou += min(d,b);
        b -= min(d,b);
    }
    cout << cou << endl;
    return 0;

}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }
    if(cou > 0)
        l.pb(cou);
    sort(l.begin(),l.end(),std::greater<ll>());

    ll ans = 0;
    for(auto v : l) {
        if(a > b) {
            swap(a,b);
        }

        ll c,d;
        if(v % 2) {
            c = v / 2;
            d = (v + 1) / 2;
        }else{
            c = d = v / 2;
        }

        cou += min(c,a);
        ll sa = min(c,a);
        a -= min(c,a);
        if(a < 1) {
            cou += min(min(sa + 1,b),d);
            b -= min(min(sa + 1,b),d);
        }else {
            cou += min(d,b);
            b -= min(d,b);
        }
    }
    cout << cou << endl;
    return 0;

}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }
    if(cou > 0)
        l.pb(cou);
    sort(l.begin(),l.end());

    ll ans = 0;
    for(auto v : l) {
        if(a > b) {
            swap(a,b);
        }

        ll c,d;
        if(v % 2) {
            c = v / 2;
            d = (v + 1) / 2;
        }else{
            c = d = v / 2;
        }

        cou += min(c,a);
        ll sa = min(c,a);
        a -= min(c,a);
        if(a < 1) {
            cou += min(min(sa + 1,b),d);
            b -= min(min(sa + 1,b),d);
        }else {
            cou += min(d,b);
            b -= min(d,b);
        }
    }
    cout << cou << endl;
    return 0;

}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }
    if(cou > 0)
        l.pb(cou);

    ll ans = 0;
    for(auto v : l) {
        if(a > b) {
            swap(a,b);
        }

        ll c,d;
        if(v % 2) {
            c = v / 2;
            d = (v + 1) / 2;
        }else{
            c = d = v / 2;
        }

        cou += min(c,a);
        ll sa = min(c,a);
        a -= min(c,a);
        if(a < 1) {
            cou += min(min(sa + 1,b),d);
            b -= min(min(sa + 1,b),d);
        }else {
            cou += min(d,b);
            b -= min(d,b);
        }
    }
    cout << cou << endl;
    return 0;

}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }
    if(cou > 0)
        l.pb(cou);
    sort(l.begin(),l.end(),std::greater<ll>());

    ll ans = 0;
    REP(i,l.size()) {
        ll v = l[i];
        if(a > b) {
            swap(a,b);
        }

        if(v / 2 <= a) {
            a -= (v / 2);
            ans += (v / 2);
            b -= (v / 2);
            ans += (v / 2);
            if(v % 2 == 1 && b > 0) {
                b -= 1;
                ans += 1;
            }
        }else{
            ll sa = a;
            ans += a;
            a = 0;
            b -= sa;
            ans += sa;
            if(sa * 2 < v && b > 0) {
                b -= 1;
                ans += 1;
                v--;
            }
            if(v - sa * 2 - 1 > 0)
                l.pb(v - sa * 2 - 1);
        }
    }
    cout << ans << endl;
    return 0;

}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }
    if(cou > 0)
        l.pb(cou);
    sort(l.begin(),l.end(),std::greater<ll>());

    ll ans = 0;
    for(auto v : l) {
        if(a > b) {
            swap(a,b);
        }

        if(v / 2 <= a) {
            a -= (v / 2);
            ans += (v / 2);
            b -= (v / 2);
            ans += (v / 2);
            if(v % 2 == 1 && b > 0) {
                b -= 1;
                ans += 1;
            }
        }else{
            ll sa = a;
            ans += a;
            a = 0;
            b -= sa;
            ans += sa;
            if(sa * 2 < v && b > 0) {
                b -= 1;
                ans += 1;
            }
        }
    }
    cout << ans << endl;
    return 0;

}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

ll n,a,b;
char s[3000000];
vector<ll> l;

int main(){
    cin >> n >> a >> b;
    cin >> s;

    ll cou = 0;
    REP(i,n) {
        if(s[i] == '.') {
            cou++;
        }else {
            if(cou > 0)
                l.pb(cou);
            cou = 0;
        }
    }

    ll ans = 0;
    for(auto v : l) {
        if(a > b) {
            swap(a,b);
        }

        ll c,d;
        if(v % 2) {
            c = v / 2;
            d = (v + 1) / 2;
        }else{
            c = d = v / 2;
        }

        cou += min(c,a);
        ll sa = min(c,a);
        a -= min(c,a);
        if(a < 1) {
            cou += min(min(sa + 1,b),d);
            b -= min(min(sa + 1,b),d);
        }else {
            cou += min(d,b);
            b -= min(d,b);
        }
    }
    cout << cou << endl;
    return 0;

}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 2e8; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 3e9; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 1e9; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 1e8 + 6e7 + 5e6; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 1e8 + 4e7 + 8e6; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 1e8 + 5e7 + 5e6; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 3e8; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 1e8; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 1e8 + 4e7 + 5e6; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 5e8; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 1e8 + 5e7; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/11/20.
//

#include <bits/stdc++.h>

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

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    int n, a, b, ans{0};
    a = 9, b = 8;
    for (int i = 0; i < 2e9 + 1e8 + 4e7; i++) {
        n = max(a + b, i);
    }
    cin >> n >> a >> b;
    int ok = 0;
    char c;
    while (cin >> c) {
        if (c == '*') {
            ok = 0;
            continue;
        }
        if (ok == 0) {
            if (a > b && a)ans++, a--, ok = 'a';
            else if (b) ans++, b--, ok = 'b';
        } else if (ok == 'a') {
            if (b)ans++, b--, ok = 'b';
            else ok = 0;
        } else {
            if (a)ans++, a--, ok = 'a';
            else ok = 0;
        }
    }
    cout << ans << endl;
}


//
// Created by misclicked on 2/12/20.
//

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;

#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

vector<pii> PB, PR;
struct edge {
    ll u, v, cost;
};

#define MAX_N 200005
int d[MAX_N];

void initialize() {
    for (int i = 0; i < MAX_N; i++)
        d[i] = i;
}

int Find(int x) {
    return d[x] == x ? x : d[x] = Find(d[x]);
}

void Union(int x, int y) {
    d[Find(x)] = Find(y);
}

bool IsSame(int x, int y) {
    return Find(x) == Find(y);
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    ll n;
    cin >> n;
    ll ans = 0;
    ll lp, rp;
    lp = LLONG_MAX;
    rp = LLONG_MIN;
    ll Bidx = 1;
    ll Ridx = 1;
    for (ll i = 0; i < n; i++) {
        ll idx;
        char ch;
        cin >> idx >> ch;
        if (ch == 'P') {
            lp = min(lp, idx);
            rp = max(rp, idx);
            PB.push_back({idx, 0});
            PR.push_back({idx, 0});
        } else if (ch == 'B') {
            PB.push_back({idx, Bidx++});
        } else {
            PR.push_back({idx, Ridx++});
        }
    }
    vector<edge> Edges;
    for (int i = 0; i < (int) PB.size() - 1; i++) {
        if (PB[i].second || PB[i + 1].second) {
            Edges.push_back({PB[i].second, PB[i + 1].second,
                             PB[i + 1].first - PB[i].first});
        }
    }
    if (Edges.size()) {
        sort(Edges.begin(), Edges.end(),
             [](const edge &a, const edge &b) {
                 return a.cost < b.cost;
             });
        initialize();
        for (int i = 0; i < Edges.size(); i++) {
            ll u = Edges[i].u;
            ll v = Edges[i].v;
            ll c = Edges[i].cost;
            if (!IsSame(u, v)) {
                ans += c;
                Union(u, v);
            }
        }
        cerr << ans << endl;
    }
    Edges.clear();
    for (int i = 0; i < (int) PR.size() - 1; i++) {
        if (PR[i].second || PR[i + 1].second) {
            Edges.push_back({PR[i].second, PR[i + 1].second,
                             PR[i + 1].first - PR[i].first});
        }
    }
    if (Edges.size()) {
        sort(Edges.begin(), Edges.end(),
             [](const edge &a, const edge &b) {
                 return a.cost < b.cost;
             });
        initialize();
        for (int i = 0; i < Edges.size(); i++) {
            ll u = Edges[i].u;
            ll v = Edges[i].v;
            ll c = Edges[i].cost;
            cerr << u << " " << v << " " << c << endl;
            if (!IsSame(u, v)) {
                ans += c;
                Union(u, v);
            }
        }
        cerr << ans << endl;
    }
    if (lp == LLONG_MAX || rp == LLONG_MIN)
        cout << ans << endl;
    else
        cout << ans + rp - lp << endl;
}


#include<bits/stdc++.h>
#define endl '\n'
#define sf scanf
#define sfi(a) sf("%d",&a)
#define sfl(a) sf("%lld",&a)
#define sffi(a,b) sf("%d %d",&a,&b)
#define sffl(a,b) sf("%lld %lld",&a,&b)
#define sfffi(a,b,c) sf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c) sf("%lld %lld %lld",&a,&b,&c)
#define pf printf
#define pfi(a) pf("%d\n",a)
#define pfl(a) pf("%lld\n",a)
#define pffi(a,b) pf("%d %d\n",a,b)
#define pffl(a,b) pf("%lld %lld\n",a,b)
#define _case cout<<"Case "<<++cs<<": "
#define lp(loop,start,end) for(ll loop=start;loop<end;loop++)
#define lpd(loop,start,end) for(ll loop=start;loop>end;loop--)

#define PI acos(-1)
#define ll long long int
#define ull unsigned long long

#define vi vector <int>
#define vll vector <ll>
#define vs vector <string>
#define pb push_back
#define mpii map <int,int>
#define mpsi map <string,int>
#define mpll map <long long,long long>
#define MP make_pair
#define F first
#define S second

#define GCD(a,b) __gcd(a,b)
#define LCM(a,b) (a*(b/__gcd(a,b)))

#define INF 10^18
#define MOD 1000000007
#define countv(v,a) count(v.begin(),v.end(),a)
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define uniq(v) v.resize( unique(all(v)) - v.begin())

#define rev(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
#define srt(v) sort(v.begin(),v.end())
#define MEM(a, b) memset(a, b, sizeof(a))

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
#define fi freopen("input.txt","r",stdin);
#define fo freopen("output.txt","w",stdout)
const ll N = 1e19;
int main()
{
    ll n,m,a,b,i,j,counT=0,k,l=0,temp=0,sum=0,Max,Min,num;
    cin>>n>>a>>b;
    string s;
    cin>>s;
    if(a<b)
        swap(a,b);

    lp(i,0,s.size()-1)
    {
        if(s[i]=='*' and s[i+1]=='.'  or ( s[i]=='.' and s[i+1] =='.' and s[i+2]=='.' ) )
        {
            if(a)
                s[i+1] = 'a',a--;
            else if(b)
                s[i+1] = 'b',b--;
        }

        else if(s[i]=='a' and s[i+1]=='.')
        {
            if(b)
                s[i+1] = 'b',b--;
        }
        else if( s[i]=='b' and s[i+1]=='.' )
        {
            if(a)
                s[i+1] = 'a',a--;
        }
        else if( s[i]=='.' and s[i+1]=='*' )
           if(a) s[i]='a',a--;

    }
///    cout<<s<<endl;
    lp(i,0,s.size())
    if(s[i]=='a' or s[i]=='b')
        counT++;

    pfl(counT);

}


#include<bits/stdc++.h>
#define endl '\n'
#define sf scanf
#define sfi(a) sf("%d",&a)
#define sfl(a) sf("%lld",&a)
#define sffi(a,b) sf("%d %d",&a,&b)
#define sffl(a,b) sf("%lld %lld",&a,&b)
#define sfffi(a,b,c) sf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c) sf("%lld %lld %lld",&a,&b,&c)
#define pf printf
#define pfi(a) pf("%d\n",a)
#define pfl(a) pf("%lld\n",a)
#define pffi(a,b) pf("%d %d\n",a,b)
#define pffl(a,b) pf("%lld %lld\n",a,b)
#define _case cout<<"Case "<<++cs<<": "
#define lp(loop,start,end) for(ll loop=start;loop<end;loop++)
#define lpd(loop,start,end) for(ll loop=start;loop>end;loop--)

#define PI acos(-1)
#define ll long long int
#define ull unsigned long long

#define vi vector <int>
#define vll vector <ll>
#define vs vector <string>
#define pb push_back
#define mpii map <int,int>
#define mpsi map <string,int>
#define mpll map <long long,long long>
#define MP make_pair
#define F first
#define S second

#define GCD(a,b) __gcd(a,b)
#define LCM(a,b) (a*(b/__gcd(a,b)))

#define INF 10^18
#define MOD 1000000007
#define countv(v,a) count(v.begin(),v.end(),a)
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define uniq(v) v.resize( unique(all(v)) - v.begin())

#define rev(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
#define srt(v) sort(v.begin(),v.end())
#define MEM(a, b) memset(a, b, sizeof(a))

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
#define fi freopen("input.txt","r",stdin);
#define fo freopen("output.txt","w",stdout)
const ll N = 1e19;
int main()
{
    ll n,m,a,b,i=0,j=0,counT=0,k,l=0,temp=0,sum=0,Max,Min,num;
    cin>>n>>a>>b;
    string s;
    cin>>s;
   while(i<n)
   {
       while(i<n && s[i]=='*')i++;
       j = i;
       while(j<n && s[j]=='.')j++;
       if(a<b)
        swap(a,b);
       counT += min(a,(j-i+1)/2)+ min(b,(j-i)/2);
       a -= min(a,(j-i+1)/2);
       b -= min(b,(j-i)/2);
       i = j;
   }
  pfl(counT);
        /*
    lp(i,0,s.size())
    {
        if(s[i]=='*' and s[i+1]=='.'  or ( s[i]=='.' and s[i+1] =='.' and s[i+2]=='.' ) )
        {
            if(a)
                s[i+1] = 'a',a--;
            else if(b)
                s[i+1] = 'b',b--;
        }

        else if(s[i]=='a' and s[i+1]=='.')
        {
            if(b)
                s[i+1] = 'b',b--;
        }
        else if( s[i]=='b' and s[i+1]=='.' )
        {
            if(a)
                s[i+1] = 'a',a--;
        }
        else if( ( s[i]=='.' and s[i+1]=='*' ) || s[i]=='.' )
           if(a) s[i]='a',a--;

    }
///    cout<<s<<endl;
    lp(i,0,s.size())
    if(s[i]=='a' or s[i]=='b')
        counT++;

    pfl(counT);
*/

}


#include<bits/stdc++.h>
#define endl '\n'
#define sf scanf
#define sfi(a) sf("%d",&a)
#define sfl(a) sf("%lld",&a)
#define sffi(a,b) sf("%d %d",&a,&b)
#define sffl(a,b) sf("%lld %lld",&a,&b)
#define sfffi(a,b,c) sf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c) sf("%lld %lld %lld",&a,&b,&c)
#define pf printf
#define pfi(a) pf("%d\n",a)
#define pfl(a) pf("%lld\n",a)
#define pffi(a,b) pf("%d %d\n",a,b)
#define pffl(a,b) pf("%lld %lld\n",a,b)
#define _case cout<<"Case "<<++cs<<": "
#define lp(loop,start,end) for(ll loop=start;loop<end;loop++)
#define lpd(loop,start,end) for(ll loop=start;loop>end;loop--)

#define PI acos(-1)
#define ll long long int
#define ull unsigned long long

#define vi vector <int>
#define vll vector <ll>
#define vs vector <string>
#define pb push_back
#define mpii map <int,int>
#define mpsi map <string,int>
#define mpll map <long long,long long>
#define MP make_pair
#define F first
#define S second

#define GCD(a,b) __gcd(a,b)
#define LCM(a,b) (a*(b/__gcd(a,b)))

#define INF 10^18
#define MOD 1000000007
#define countv(v,a) count(v.begin(),v.end(),a)
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define uniq(v) v.resize( unique(all(v)) - v.begin())

#define rev(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
#define srt(v) sort(v.begin(),v.end())
#define MEM(a, b) memset(a, b, sizeof(a))

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
#define fi freopen("input.txt","r",stdin);
#define fo freopen("output.txt","w",stdout)
const ll N = 1e19;
int main()
{
    ll n,m,a,b,i,j,counT=0,k,l=0,temp=0,sum=0,Max,Min,num;
    cin>>n>>a>>b;
    string s;
   // cin>>s;
    if(a<b)
        swap(a,b);
    lp(i,0,s.size())
    if(s[i]=='.')
            counT++;

    if(counT>(a+b))
        cout<<a+b;
        else
            cout<<counT;

        /*
    lp(i,0,s.size())
    {
        if(s[i]=='*' and s[i+1]=='.'  or ( s[i]=='.' and s[i+1] =='.' and s[i+2]=='.' ) )
        {
            if(a)
                s[i+1] = 'a',a--;
            else if(b)
                s[i+1] = 'b',b--;
        }

        else if(s[i]=='a' and s[i+1]=='.')
        {
            if(b)
                s[i+1] = 'b',b--;
        }
        else if( s[i]=='b' and s[i+1]=='.' )
        {
            if(a)
                s[i+1] = 'a',a--;
        }
        else if( ( s[i]=='.' and s[i+1]=='*' ) || s[i]=='.' )
           if(a) s[i]='a',a--;

    }
///    cout<<s<<endl;
    lp(i,0,s.size())
    if(s[i]=='a' or s[i]=='b')
        counT++;

    pfl(counT);
*/

}


#include<bits/stdc++.h>
#define endl '\n'
#define sf scanf
#define sfi(a) sf("%d",&a)
#define sfl(a) sf("%lld",&a)
#define sffi(a,b) sf("%d %d",&a,&b)
#define sffl(a,b) sf("%lld %lld",&a,&b)
#define sfffi(a,b,c) sf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c) sf("%lld %lld %lld",&a,&b,&c)
#define pf printf
#define pfi(a) pf("%d\n",a)
#define pfl(a) pf("%lld\n",a)
#define pffi(a,b) pf("%d %d\n",a,b)
#define pffl(a,b) pf("%lld %lld\n",a,b)
#define _case cout<<"Case "<<++cs<<": "
#define lp(loop,start,end) for(ll loop=start;loop<end;loop++)
#define lpd(loop,start,end) for(ll loop=start;loop>end;loop--)

#define PI acos(-1)
#define ll long long int
#define ull unsigned long long

#define vi vector <int>
#define vll vector <ll>
#define vs vector <string>
#define pb push_back
#define mpii map <int,int>
#define mpsi map <string,int>
#define mpll map <long long,long long>
#define MP make_pair
#define F first
#define S second

#define GCD(a,b) __gcd(a,b)
#define LCM(a,b) (a*(b/__gcd(a,b)))

#define INF 10^18
#define MOD 1000000007
#define countv(v,a) count(v.begin(),v.end(),a)
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define uniq(v) v.resize( unique(all(v)) - v.begin())

#define rev(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
#define srt(v) sort(v.begin(),v.end())
#define MEM(a, b) memset(a, b, sizeof(a))

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
#define fi freopen("input.txt","r",stdin);
#define fo freopen("output.txt","w",stdout)
const ll N = 1e19;
int main()
{
    ll n,m,a,b,i,j,counT=0,k,l=0,temp=0,sum=0,Max,Min,num;
    cin>>n>>a>>b;
    string s;
    cin>>s;
    if(a<b)
        swap(a,b);

    lp(i,0,s.size())
    {
        if(s[i]=='*' and s[i+1]=='.'  or ( s[i]=='.' and s[i+1] =='.' and s[i+2]=='.' ) )
        {
            if(a)
                s[i+1] = 'a',a--;
            else if(b)
                s[i+1] = 'b',b--;
        }

        else if(s[i]=='a' and s[i+1]=='.')
        {
            if(b)
                s[i+1] = 'b',b--;
        }
        else if( s[i]=='b' and s[i+1]=='.' )
        {
            if(a)
                s[i+1] = 'a',a--;
        }
        else if( ( s[i]=='.' and s[i+1]=='*' ) || s[i]=='.' )
           if(a) s[i]='a',a--;

    }
///    cout<<s<<endl;
    lp(i,0,s.size())
    if(s[i]=='a' or s[i]=='b')
        counT++;

    pfl(counT);

}


#include<bits/stdc++.h>
#define endl '\n'
#define sf scanf
#define sfi(a) sf("%d",&a)
#define sfl(a) sf("%lld",&a)
#define sffi(a,b) sf("%d %d",&a,&b)
#define sffl(a,b) sf("%lld %lld",&a,&b)
#define sfffi(a,b,c) sf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c) sf("%lld %lld %lld",&a,&b,&c)
#define pf printf
#define pfi(a) pf("%d\n",a)
#define pfl(a) pf("%lld\n",a)
#define pffi(a,b) pf("%d %d\n",a,b)
#define pffl(a,b) pf("%lld %lld\n",a,b)
#define _case cout<<"Case "<<++cs<<": "
#define lp(loop,start,end) for(ll loop=start;loop<end;loop++)
#define lpd(loop,start,end) for(ll loop=start;loop>end;loop--)

#define PI acos(-1)
#define ll long long int
#define ull unsigned long long

#define vi vector <int>
#define vll vector <ll>
#define vs vector <string>
#define pb push_back
#define mpii map <int,int>
#define mpsi map <string,int>
#define mpll map <long long,long long>
#define MP make_pair
#define F first
#define S second

#define GCD(a,b) __gcd(a,b)
#define LCM(a,b) (a*(b/__gcd(a,b)))

#define INF 10^18
#define MOD 1000000007
#define countv(v,a) count(v.begin(),v.end(),a)
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define uniq(v) v.resize( unique(all(v)) - v.begin())

#define rev(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
#define srt(v) sort(v.begin(),v.end())
#define MEM(a, b) memset(a, b, sizeof(a))

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
#define fi freopen("input.txt","r",stdin);
#define fo freopen("output.txt","w",stdout)
const ll N = 1e19;
int main()
{
    ll n,m,a,b,i,j,counT=0,k,l=0,temp=0,sum=0,Max,Min,num;
    cin>>n>>a>>b;
    string s;
    cin>>s;
    if(a<b)
        swap(a,b);

    lp(i,0,s.size()-1)
    {
        if(s[i]=='*' and s[i+1]=='.' )
        {
            if(a)
                s[i+1] = 'a',a--;
            else if(b)
                s[i+1] = 'b',b--;
        }

        else if(s[i]=='a' and s[i+1]=='.')
        {
            if(b)
                s[i+1] = 'b',b--;
        }
        else if(s[i]=='b' and s[i+1]=='.')
        {
            if(a)
                s[i+1] = 'a',a--;
        }
        else if( s[i]=='.' and s[i+1] =='.' and s[i+2]=='.')
        {
            if(a)
                s[i] = 'a',a--;
            if(b)
                s[i+1] = 'b',b--;
        }
    }
 ///   cout<<s<<endl;
    lp(i,0,s.size())
    if(s[i]=='a' or s[i]=='b')
        counT++;

    pfl(counT);

}


#include<bits/stdc++.h>
#define endl '\n'
#define sf scanf
#define sfi(a) sf("%d",&a)
#define sfl(a) sf("%lld",&a)
#define sffi(a,b) sf("%d %d",&a,&b)
#define sffl(a,b) sf("%lld %lld",&a,&b)
#define sfffi(a,b,c) sf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c) sf("%lld %lld %lld",&a,&b,&c)
#define pf printf
#define pfi(a) pf("%d\n",a)
#define pfl(a) pf("%lld\n",a)
#define pffi(a,b) pf("%d %d\n",a,b)
#define pffl(a,b) pf("%lld %lld\n",a,b)
#define _case cout<<"Case "<<++cs<<": "
#define lp(loop,start,end) for(ll loop=start;loop<end;loop++)
#define lpd(loop,start,end) for(ll loop=start;loop>end;loop--)

#define PI acos(-1)
#define ll long long int
#define ull unsigned long long

#define vi vector <int>
#define vll vector <ll>
#define vs vector <string>
#define pb push_back
#define mpii map <int,int>
#define mpsi map <string,int>
#define mpll map <long long,long long>
#define MP make_pair
#define F first
#define S second

#define GCD(a,b) __gcd(a,b)
#define LCM(a,b) (a*(b/__gcd(a,b)))

#define INF 10^18
#define MOD 1000000007
#define countv(v,a) count(v.begin(),v.end(),a)
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define uniq(v) v.resize( unique(all(v)) - v.begin())

#define rev(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
#define srt(v) sort(v.begin(),v.end())
#define MEM(a, b) memset(a, b, sizeof(a))

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
#define fi freopen("input.txt","r",stdin);
#define fo freopen("output.txt","w",stdout)
const ll N = 1e19;
int main()
{
    ll n,m,a,b,i=0,j=0,counT=0,k,l=0,temp=0,sum=0,Max,Min,num;
    cin>>n>>a>>b;
    string s;
    cin>>s;
   while(i<n)
   {
       while(i<n && s[i]=='*')i++;
       j = i;
       while(j<n && s[j]=='.')j++;
       if(a<b)
        swap(a,b);
       counT += min(a,(j-i+1)/2)+ min(b,(j-i)/2);
       a -= min(a,(j-i+1)/2);
       b -= min(b,(j-i)/2);
       i = j;
   }
  pfl(counT);

}


#include <bits/stdc++.h>

#define xrange(i, a, b) for(int i=(a); i<=(b); ++i)
#define rrange(i, a, b) for(int i=(a); i>=(b); --i)

class raw_input{
public:
    template <typename T>
    raw_input& operator>>(T& arg){
        if constexpr ( std::is_integral<T>::value ){
            if constexpr (sizeof(T) == sizeof(int)){
                scanf("%d", &arg);
            }else{
                scanf("%lld", &arg);
            }
        }
        if constexpr ( std::is_floating_point<T>::value){
            if constexpr (sizeof(T) == sizeof(double)){
                scanf("%lf", &arg);
            }else{
                scanf("%LF", &arg);
            }
        }
        return *this;
    }
    raw_input& operator>>(char* arg){
        scanf("%s", arg);
        return *this;
    }
    raw_input& operator>>(char& c){
        while( (c = getchar()) != EOF && (c == ' ' || c == '\n') );
        return *this;
    }
} gin{};

using namespace std;

#define MAX 200005

int A[ MAX ];

int n;

bool solve(int a, int b, int mmax){

    bool gate = true;
    int prev = -1;

    for(int i=0; i<n; ++i){
        if(mmax == 0) return true;

        if( A[i] == -1){
            gate = true;
            continue;
        }

        if(gate){

            gate = false;

            if( (prev == -1) || (prev == 0 && a ) ){
                prev = 0;
                -- mmax;
                -- a;
                continue;
            } else if(prev == 0 && a == 0){
                prev = 1;
                -- b;
                -- mmax;
                continue;
            }

            if(prev == 1 && b){
                prev = 1;
                -- b;
                -- mmax;
                continue;
            }else if( prev == 1 && b == 0){
                prev = 0;
                -- a;
                -- mmax;
                continue;
            }
        }

        if(prev == 0 && b){
            prev = 1;
            -- mmax;
            -- b;
            continue;
        }else if( prev == 0 && b == 0){
            gate = true;
            continue;
        }

        if(prev == 1 && a){
            prev = 0;
            -- mmax;
            -- a;
            continue;
        }else if(prev == 1 && a == 0){
            gate = true;
            continue;
        }
    } return (mmax == 0);
}

int main() {

#ifdef LOCAL_DEFINE
    freopen("in", "rt", stdin);
#endif

    // solution Here
    int c1, c2; cin >> n >> c1 >> c2;

    xrange(i, 0, n-1){
        char c;
        gin >> c;
        if(c == '*') A[i] = -1;
        else A[i] = 0;
    }

    int l = 0;
    int r = c1 + c2;
    int ans = 0;

    while(l <= r){

        int m = (l + r) >> 1;

        bool r1 = solve(c1, c2, m);
        bool r2 = solve(c2, c1, m);

        if(r1 || r2){
            ans = m;
            l = m + 1;
        }else{
            r = m - 1;
        }
    }

    cout << ans << endl;

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif

    return 0;
}


#include <bits/stdc++.h>

#define xrange(i, a, b) for(int i=(a); i<=(b); ++i)
#define rrange(i, a, b) for(int i=(a); i>=(b); --i)

class raw_input{
public:
    template <typename T>
    raw_input& operator>>(T& arg){
        if constexpr ( std::is_integral<T>::value ){
            if constexpr (sizeof(T) == sizeof(int)){
                scanf("%d", &arg);
            }else{
                scanf("%lld", &arg);
            }
        }
        if constexpr ( std::is_floating_point<T>::value){
            if constexpr (sizeof(T) == sizeof(double)){
                scanf("%lf", &arg);
            }else{
                scanf("%LF", &arg);
            }
        }
        return *this;
    }
    raw_input& operator>>(char* arg){
        scanf("%s", arg);
        return *this;
    }
    raw_input& operator>>(char& c){
        while( (c = getchar()) != EOF && (c == ' ' || c == '\n') );
        return *this;
    }
} gin{};

using namespace std;

#define MAX 200005

char a [ MAX ];
int  b [ MAX ];

int main() {

#ifdef LOCAL_DEFINE
    freopen("in", "rt", stdin);
#endif
    // solution Here

    int n, x, y; gin >> n >> x >> y;
    if(x < y) swap(x, y);

    xrange(i, 0, n-1){
        gin >> a[i];
    }

    rrange(i, n-1, 0){
        if( a[i] == '*'){
            b[ i ] = 0;
            continue;
        }

        b [ i ] = 1;
        if(i + 1 < n){
            b [ i ] += b [ i + 1];
        }
    }

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

        if( a[ i ] == '*'){
            ++ i;
            continue;
        }

        int mmax = b [ i ];

        ans += min(x , mmax >> 1);
        ans += min(y , mmax >> 1);

        x -= min(x, mmax >> 1);
        y -= min(y, mmax >> 1);

        if(mmax & 1){

            if(x){
                ans += 1;
                -- x;
            }else if(y){
                ans += 1;
                -- y;
            }
        }
        while(a[i++] == '.');
    }

    cout << ans << endl;

#ifdef LOCAL_DEFINE
    // cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif

    return 0;
}


#include <bits/stdc++.h>

#define xrange(i, a, b) for(int i=(a); i<=(b); ++i)
#define rrange(i, a, b) for(int i=(a); i>=(b); --i)

class raw_input{
public:
	template <typename T>
	raw_input& operator>>(T& arg){
		if constexpr ( std::is_integral<T>::value ){
			if constexpr (sizeof(T) == sizeof(int)){
				scanf("%d", &arg);
			}else{
				scanf("%lld", &arg);
			}
		}
		if constexpr ( std::is_floating_point<T>::value){
			if constexpr (sizeof(T) == sizeof(double)){
				scanf("%lf", &arg);
			}else{
				scanf("%LF", &arg);
			}
		}
		return *this;
	}
	raw_input& operator>>(char* arg){
		scanf("%s", arg);
		return *this;
	}
	raw_input& operator>>(char& c){
		while( (c = getchar()) != EOF && (c == ' ' || c == '\n') );
		return *this;
	}
} gin{};

using namespace std;

#define MAX 200005

int a[ MAX ];

int n;

int fill(int v){
    if(v == 0) return 0;

    int d = 0;
    bool cap = false;

    xrange(i, 0, n-1){
        if(a[i] == 1){
            cap = false;
            continue;
        }

        if(a[i] == 0 && cap == true){
            cap = false;
            continue;
        }

        a[i] = 1;
        cap = true;

        d += 1;
        v -= 1;

        if(v == 0) break;
    } return d;
}

int main() {

#ifdef LOCAL_DEFINE
    freopen("in", "rt", stdin);
#endif

    // solution Here
    int aa, bb; cin >> n >> aa >> bb;

    xrange(i, 0, n-1){
        char c;
        gin >> c;
        if(c == '*') a[i] = 1;
        else a[i] = 0;
    }

    int ans = 0;

    ans += fill(max(aa, bb));
    ans += fill(min(aa, bb));

    cout << ans << endl;

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif

    return 0;
}


#include <bits/stdc++.h>

#define xrange(i, a, b) for(int i=(a); i<=(b); ++i)
#define rrange(i, a, b) for(int i=(a); i>=(b); --i)

class raw_input{
public:
    template <typename T>
    raw_input& operator>>(T& arg){
        if constexpr ( std::is_integral<T>::value ){
            if constexpr (sizeof(T) == sizeof(int)){
                scanf("%d", &arg);
            }else{
                scanf("%lld", &arg);
            }
        }
        if constexpr ( std::is_floating_point<T>::value){
            if constexpr (sizeof(T) == sizeof(double)){
                scanf("%lf", &arg);
            }else{
                scanf("%LF", &arg);
            }
        }
        return *this;
    }
    raw_input& operator>>(char* arg){
        scanf("%s", arg);
        return *this;
    }
    raw_input& operator>>(char& c){
        while( (c = getchar()) != EOF && (c == ' ' || c == '\n') );
        return *this;
    }
} gin{};

using namespace std;

#define MAX 200005

char a [ MAX ];
int  b [ MAX ];

int main() {

#ifdef LOCAL_DEFINE
    freopen("in", "rt", stdin);
#endif
    // solution Here

    int n, x, y; gin >> n >> x >> y;
    if(x < y) swap(x, y);

    xrange(i, 0, n-1){
        gin >> a[i];
    }

    rrange(i, n-1, 0){
        if( a[i] == '*'){
            b[ i ] = 0;
            continue;
        }

        b [ i ] = 1;
        if(i + 1 < n){
            b [ i ] += b [ i + 1];
        }
    }

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

        if( a[ i ] == '*'){
            ++ i;
            continue;
        }

        int mmax = b [ i ];

        ans += min(x , mmax >> 1);
        ans += min(y , mmax >> 1);

        x -= min(x, mmax >> 1);
        y -= min(y, mmax >> 1);

        if(mmax & 1 && max(x, y) ){

            if(x > y){
                ans += 1;
                -- x;
            }else{
                ans += 1;
                -- y;
            }
        }

        while(a[i++] == '.');
    }

    cout << ans << endl;

#ifdef LOCAL_DEFINE
    // cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif

    return 0;
}


#include <bits/stdc++.h>

#define xrange(i, a, b) for(int i=(a); i<=(b); ++i)
#define rrange(i, a, b) for(int i=(a); i>=(b); --i)

class raw_input{
public:
	template <typename T>
	raw_input& operator>>(T& arg){
		if constexpr ( std::is_integral<T>::value ){
			if constexpr (sizeof(T) == sizeof(int)){
				scanf("%d", &arg);
			}else{
				scanf("%lld", &arg);
			}
		}
		if constexpr ( std::is_floating_point<T>::value){
			if constexpr (sizeof(T) == sizeof(double)){
				scanf("%lf", &arg);
			}else{
				scanf("%LF", &arg);
			}
		}
		return *this;
	}
	raw_input& operator>>(char* arg){
		scanf("%s", arg);
		return *this;
	}
	raw_input& operator>>(char& c){
		while( (c = getchar()) != EOF && (c == ' ' || c == '\n') );
		return *this;
	}
} gin{};

using namespace std;

#define MAX 200005

int a[ MAX ];

int n;

int fill(int v){
    if(v == 0) return 0;

    int d = 0;
    bool cap = false;

    xrange(i, 0, n-1){
        if(a[i] == 1){
            cap = false;
            continue;
        }

        if(a[i] == 0 && cap == true){
            cap = false;
            continue;
        }

        a[i] = 1;
        cap = true;

        d += 1;
        v -= 1;

        if(v == 0) break;
    } return d;
}

int main() {

   	ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;

#ifdef LOCAL_DEFINE
    freopen("in", "rt", stdin);
#endif

    // solution Here
    int aa, bb; cin >> n >> aa >> bb;

    xrange(i, 0, n-1){
        char c;
        gin >> c;
        if(c == '*') a[i] = 1;
        else a[i] = 0;
    }

    int ans = 0;

    ans += fill(max(aa, bb));
    ans += fill(min(aa, bb));

    cout << ans << endl;

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif

    return 0;
}


#include <bits/stdc++.h>

#define xrange(i, a, b) for(int i=(a); i<=(b); ++i)
#define rrange(i, a, b) for(int i=(a); i>=(b); --i)

class raw_input{
public:
    template <typename T>
    raw_input& operator>>(T& arg){
        if constexpr ( std::is_integral<T>::value ){
            if constexpr (sizeof(T) == sizeof(int)){
                scanf("%d", &arg);
            }else{
                scanf("%lld", &arg);
            }
        }
        if constexpr ( std::is_floating_point<T>::value){
            if constexpr (sizeof(T) == sizeof(double)){
                scanf("%lf", &arg);
            }else{
                scanf("%LF", &arg);
            }
        }
        return *this;
    }
    raw_input& operator>>(char* arg){
        scanf("%s", arg);
        return *this;
    }
    raw_input& operator>>(char& c){
        while( (c = getchar()) != EOF && (c == ' ' || c == '\n') );
        return *this;
    }
} gin{};

using namespace std;

#define MAX 200005

int A[ MAX ];

int n;

int solve(int a, int b, int c1, int c2){

    bool gate = true;
    int prev = -1;
    int ans = 0;

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

        if(A[i] == -1 || (1LL * c1 + c2) == 0){
            gate = true;
            continue;
        }

        if(gate){
            if(c1){
                prev = a;
                ++ ans;
                -- c1;
            }else if(c2){
                prev = b;
                ++ ans;
                -- c2;
            }
            gate = false;
            continue;
        }

        if(prev == a && c2){
            ++ ans;
            c2 --;
            prev = b;
        }else if(prev == b && c1){
            ++ ans;
            -- c1;
            prev = a;
        }
    } return ans;
}
int main() {

#ifdef LOCAL_DEFINE
    freopen("in", "rt", stdin);
#endif

    // solution Here
    int aa, bb; cin >> n >> aa >> bb;

    xrange(i, 0, n-1){
        char c;
        gin >> c;
        if(c == '*') A[i] = -1;
        else A[i] = 0;
    }

    int ans = 0;

    ans = max(ans, solve(0, 1, aa, bb) );
    ans = max(ans, solve(1, 0, bb, aa) );

    cout << ans << endl;

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif

    return 0;
}


#include <bits/stdc++.h>

#define xrange(i, a, b) for(int i=(a); i<=(b); ++i)
#define rrange(i, a, b) for(int i=(a); i>=(b); --i)

class raw_input{
public:
    template <typename T>
    raw_input& operator>>(T& arg){
        if constexpr ( std::is_integral<T>::value ){
            if constexpr (sizeof(T) == sizeof(int)){
                scanf("%d", &arg);
            }else{
                scanf("%lld", &arg);
            }
        }
        if constexpr ( std::is_floating_point<T>::value){
            if constexpr (sizeof(T) == sizeof(double)){
                scanf("%lf", &arg);
            }else{
                scanf("%LF", &arg);
            }
        }
        return *this;
    }
    raw_input& operator>>(char* arg){
        scanf("%s", arg);
        return *this;
    }
    raw_input& operator>>(char& c){
        while( (c = getchar()) != EOF && (c == ' ' || c == '\n') );
        return *this;
    }
} gin{};

using namespace std;

#define MAX 200005

int A[ MAX ];

int n;

int solve(int a, int b, int c1, int c2){

    bool gate = true;
    int prev = -1;
    int ans = 0;

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

        if(A[i] == -1 || (1LL * c1 + c2) == 0){
            gate = true;
            continue;
        }

        if(gate){
            if(c1){
                prev = a;
                ++ ans;
                -- c1;
            }else if(c2){
                prev = b;
                ++ ans;
                -- c2;
            }
            gate = false;
            continue;
        }

        if(prev == a && c2){
            ++ ans;
            c2 --;
            prev = b;
        }else if(prev == b && c1){
            ++ ans;
            -- c1;
            prev = a;
        }
    } return ans;
}
int main() {

#ifdef LOCAL_DEFINE
    freopen("in", "rt", stdin);
#endif

    // solution Here
    int aa, bb; cin >> n >> aa >> bb;

    xrange(i, 0, n-1){
        char c;
        gin >> c;
        if(c == '*') A[i] = -1;
        else A[i] = 0;
    }

    int ans = 0;

    ans = max(ans, solve(0, 1, aa, bb) );
    // ans = max(ans, solve(1, 0, bb, aa) );

    cout << ans << endl;

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif

    return 0;
}


    #include <iostream>
    #include <algorithm>
    #include <bits/stdc++.h>
    #define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    #define ll long long
    #define mm(arr) memset(arr, 0, sizeof(arr))
    #define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
    #define pb push_back
    #define PI 3.141592653589793
    #define MOD 1000000007

    using namespace std;
    int main(){
        FAST
        int n,a,b; cin >> n >> a >> b;
        string s; cin >> s;
        int cnt=0;
        int current;
        int lastcurrent;
        int ft=1;
        for(int i=0;i<s.size();i++){
            if(s[i] == '.'){
                    if(ft==1){
                        a--;
                        current=2;
                        lastcurrent=1;
                        ft=0;
                        cnt++;
                        if(i!=n-1){
                        if(s[i+1]=='*'){
                            if(lastcurrent==2){
                                current=2;
                            }
                            else{
                                current=1;
                            }
                        }
                    }
                        continue;
                    }
                    if(current==2 && b>0){
                        b--;
                        current=1;
                        lastcurrent=2;
                        cnt++;
                        if(i!=n-1){
                        if(s[i+1]=='*'){
                            if(lastcurrent==2){
                                current=2;
                            }
                            else{
                                current=1;
                            }
                        }
                    }
                        continue;              }
                    if(current == 1 && a>0){
                        current=2;
                        lastcurrent=1;
                        a--;
                        cnt++;
                        if(i!=n-1){
                        if(s[i+1]=='*'){
                            if(lastcurrent==2){
                                current=2;
                            }
                            else{
                                current=1;
                            }
                        }
                    }
                        continue;
                    }
            }
        }
        cout << cnt << endl;
        return 0;
    }


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007
using namespace std;
int main(){
    FAST
    int n,a,b; cin >> n >> a >> b;
    string s; cin >> s;
    int cnt=0;
    int next;
    int ft=1;
    if(b>a)swap(a, b);
    for(int i=0;i<s.size();i++){
        if(s[i] == '.'){
                if(ft==1){
                    a--;
                    next=2;
                    ft=0;
                    cnt++;
                    continue;
                }
                if(next == 2 && b>0){
                    b--;
                    next=1;
                    cnt++;
                    continue;
                }
                if(next == 1 && a>0){
                    next=2;
                    a--;
                    cnt++;
                    continue;
                }
                next = 3 - next;
            }
            else{
                ft = 1;
                if(a < b){
                    swap(a, b);
                }
            }
        }
    cout << cnt << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007
using namespace std;
int main(){
    FAST
    int n,a,b; cin >> n >> a >> b;
    string s; cin >> s;
    int cnt=0;
    int next;
    int last;
    int ft=1;
    if(a<b){
        swap(a,b);
    }
    for(int i=0;i<s.size();i++){
        if(s[i] == '.'){
                if(ft==1){
                    if(a < b){
                        swap(a, b);
                    }
                    a--;
                    next=2;
                    last=1;
                    ft=0;
                    cnt++;
                    continue;
                }
                if(next==2 && b>0){
                    b--;
                    next=1;
                    last=2;
                    cnt++;
                    continue;
                }
                if(next == 1 && a>0){
                    next=2;
                    last=1;
                    a--;
                    cnt++;
                    continue;
                }
                if(next == 2){
                    next = 1;
                }
                else{
                    next = 2;
                }
            }
            else{
                ft = 1;
            }
        }
    cout << cnt << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007

using namespace std;
int main(){
    FAST
    int n,a,b; cin >> n >> a >> b;
    string s; cin >> s;
    int cnt=0;
    int current;
    int lastcurrent;
    int ft=1;
    for(int i=0;i<s.size();i++){
        if(s[i] == '.'){
                if(i!=n-1){
                    if(s[i+1]=='*'){
                        if(lastcurrent==2){
                            current=2;
                        }
                        else{
                            current=1;
                        }
                    }
                }
                if(ft==1){
                    a--;
                    current=2;
                    lastcurrent=1;
                    ft=0;
                    cnt++;
                    continue;
                }
                if(current==2 && b>0){
                    b--;
                    current=1;
                    lastcurrent=2;
                    cnt++;
                    continue;              }
                if(current == 1 && a>0){
                    current=2;
                    lastcurrent=1;
                    a--;
                    cnt++;
                    continue;
                }
        }
    }
    cout << cnt << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007
using namespace std;
int main(){
    FAST
    int n,a,b; cin >> n >> a >> b;
    string s; cin >> s;
    int cnt=0;
    int next;
    int ft=1;
    if(b>a)swap(a, b);
    for(int i=0;i<s.size();i++){
        if(a == 0 && b == 0)break;
        if(s[i] == '.'){
                if(ft==1){
                    if(a < b)swap(a, b);
                    a--;
                    next=2;
                    ft=0;
                    cnt++;
                    continue;
                }
                if(next == 2 && b>0){
                    b--;
                    next=1;
                    cnt++;
                    continue;
                }
                if(next == 1 && a>0){
                    next=2;
                    a--;
                    cnt++;
                    continue;
                }
                next = 3 - next;
            }
            else{
                ft = 1;
                if(a < b){
                    swap(a, b);
                }
            }
        }
    cout << cnt << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007

using namespace std;
int main(){
    FAST
    int n,a,b; cin >> n >> a >> b;
    string s; cin >> s;
    int cnt=0;
    int next;
    int ft=1;
    for(int i=0;i<s.size();i++){
        if(s[i] == '.'){
                if(ft==1){
                        if(a<b){
        swap(a,b);
    }
                    a--;
                    next=2;
                    ft=0;
                    cnt++;
                    continue;
                }
                if(next==2 && b>0){
                    b--;
                    next=1;
                    cnt++;
                    continue;
                }
                if(next == 1 && a>0){
                    next=2;
                    a--;
                    cnt++;
                    continue;
                }
            }
        }
    cout << cnt << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007
using namespace std;
int main(){
    FAST
    int n,a,b; cin >> n >> a >> b;
    string s; cin >> s;
    int cnt=0;
    int next;
    int last;
    int ft=1;
    for(int i=0;i<s.size();i++){
        if(s[i] == '.'){
                if(ft==1){
                    if(a < b){
                        swap(a, b);
                    }
                    a--;
                    next=2;
                    last=1;
                    ft=0;
                    cnt++;
                    continue;
                }
                if(next==2 && b>0){
                    b--;
                    next=1;
                    last=2;
                    cnt++;
                    continue;
                }
                if(next == 1 && a>0){
                    next=2;
                    last=1;
                    a--;
                    cnt++;
                    continue;
                }
                if(next == 2){
                    next = 1;
                }
                else{
                    next = 2;
                }
            }
            else{
                ft = 1;
            }
        }
    cout << cnt << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007
using namespace std;
int main(){
    FAST
    int n,a,b; cin >> n >> a >> b;
    string s; cin >> s;
    int cnt=0;
    int next;
    int ft=1;
    for(int i=0;i<s.size();i++){
        if(s[i] == '.'){
                if(ft==1){
                    if(a < b){
                        swap(a, b);
                    }
                    a--;
                    next=2;
                    ft=0;
                    cnt++;
                    continue;
                }
                if(next==2 && b>0){
                    b--;
                    next=1;
                    cnt++;
                    continue;
                }
                if(next == 1 && a>0){
                    next=2;
                    a--;
                    cnt++;
                    continue;
                }
                if(next == 2){
                    next = 1;
                }
                else{
                    next = 2;
                }
            }
            else{
                ft = 1;
            }
        }
    cout << cnt << endl;
    return 0;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <queue>
#include <cmath>

using namespace std;

#define endl "\n"

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

    int n, a, b; cin >> n >> a >> b;
    string s; cin >> s;

    vector<int> seg;

    int cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '*') {
            if (cur != 0) seg.push_back(cur);
            cur = 0;
        } else ++cur;
    }
    if (cur != 0) seg.push_back(cur);
    sort(seg.begin(), seg.end());
    reverse(seg.begin(), seg.end());
    int ans = 0;
    for (int i : seg) {
        if (a < b) swap(a, b);
        if (b == 0 && a > 0) {
            ans += min(a, (i+1)/2);
            a -= min(a, (i+1)/2);
        } else if (i/2 <= b) {
            ans += i/2;
            b -= i/2;
            ans += min(a, (i+1)/2);
            a -= min(a, (i+1)/2);
        } else {
            int da = min({a, b+1, (i+1)/2});
            ans += da;
            int db = min({b, i - min({a, b+1, (i+1)/2}) });
            ans += db;
            a -= da;
            b -= db;
            i -= da + db;
            if (a < b) {
                swap(a, b);
                swap(da, db);
            }
            if (b == 0) {
                if (da > db) {
                    --i;
                }
                ans += min(a, (i+1)/2);
                a -= min(a, (i+1)/2);
            }
        }
    }
    cout << ans << endl;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <queue>
#include <cmath>

using namespace std;

#define endl "\n"

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

    int n, a, b; cin >> n >> a >> b;
    string s; cin >> s;

    vector<int> seg;

    int cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '*') {
            if (cur != 0) seg.push_back(cur);
            cur = 0;
        } else ++cur;
    }
    if (cur != 0) seg.push_back(cur);

    int ans = 0;
    for (int i : seg) {
        if (a < b) swap(a, b);
        if (b == 0 && a > 0) {
            ++ans;
            --a;
        } else if (a >= (i+1)/2 && b >= i/2) {
            ans += i;
            a -= (i+1)/2;
            b -= i/2;
        } else if (b <= i/2 && b > 0) {
            ans += b;
            if (a > b) {
                ans += b+1;
                a -= b+1;
            } else {
                ans += b;
                a -= b;
            }
            b = 0;
        }
    }
    cout << ans << endl;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <queue>
#include <cmath>

using namespace std;

#define endl "\n"

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

    int n, a, b; cin >> n >> a >> b;
    string s; cin >> s;

    vector<int> seg;

    int cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '*') {
            if (cur != 0) seg.push_back(cur);
            cur = 0;
        } else ++cur;
    }
    if (cur != 0) seg.push_back(cur);

    int ans = 0;
    for (int i : seg) {
        if (a < b) swap(a, b);
        if (i/2 <= b) {
            ans += i/2;
            b -= i/2;
            ans += min(a, (i+1)/2);
            a -= min(a, (i+1)/2);
        } else {
            ans += b;
            ans += min({a, b+1, i-b});
            a -= min({a, b+1, i-b});
            b = 0;
        }
    }
    cout << ans << endl;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <queue>
#include <cmath>

using namespace std;

#define endl "\n"

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

    int n, a, b; cin >> n >> a >> b;
    string s; cin >> s;

    vector<int> seg;

    int cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '*') {
            if (cur != 0) seg.push_back(cur);
            cur = 0;
        } else ++cur;
    }
    if (cur != 0) seg.push_back(cur);
    sort(seg.begin(), seg.end());
    reverse(seg.begin(), seg.end());
    int ans = 0;
    for (int i : seg) {
        if (a < b) swap(a, b);
        if (i/2 <= b) {
            ans += i/2;
            b -= i/2;
            ans += min(a, (i+1)/2);
            a -= min(a, (i+1)/2);
        } else {
            ans += b;
            ans += min({a, b+1, i-b});
            a -= min({a, b+1, i-b});
            b = 0;
        }
    }
    cout << ans << endl;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <queue>
#include <cmath>

using namespace std;

#define endl "\n"

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

    int n, a, b; cin >> n >> a >> b;
    string s; cin >> s;

    vector<int> seg;

    int cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '*') {
            if (cur != 0) seg.push_back(cur);
            cur = 0;
        } else ++cur;
    }
    if (cur != 0) seg.push_back(cur);

    int ans = 0;
    for (int i : seg) {
        if (a < b) swap(a, b);
        if (b == 0 && a > 0) {
            ++ans;
            --a;
        } else if (a >= (i+1)/2 && b >= i/2) {
            ans += i;
            a -= (i+1)/2;
            b -= i/2;
        } else if (b <= i/2 && b > 0) {
            ans += b;
            if (a > b) {
                ans += b+1;
                a -= b+1;
            } else {
                ans += b;
                a -= b+1;
            }
            b = 0;
        }
    }
    cout << ans << endl;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <queue>
#include <cmath>

using namespace std;

#define endl "\n"

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

    int n, a, b; cin >> n >> a >> b;
    string s; cin >> s;

    vector<int> seg;

    int cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '*') {
            if (cur != 0) seg.push_back(cur);
            cur = 0;
        } else ++cur;
    }
    if (cur != 0) seg.push_back(cur);
    sort(seg.begin(), seg.end());
    reverse(seg.begin(), seg.end());
    int ans = 0;
    for (int i : seg) {
        if (a < b) swap(a, b);
        if (b == 0 && a > 0) {
            ans += min(a, (i+1)/2);
            a -= min(a, (i+1)/2);
        } else if (i/2 <= b) {
            ans += i/2;
            b -= i/2;
            ans += min(a, (i+1)/2);
            a -= min(a, (i+1)/2);
        } else {
            ans += min({a, b+1, (i+1)/2});
            int db = min({b, i -min({a, b+1, (i+1)/2}) });
            ans += db;
            a -= min({a, b+1, (i+1)/2});
            b -= db;
        }
    }
    cout << ans << endl;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <queue>
#include <cmath>

using namespace std;

#define endl "\n"

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

    int n, a, b; cin >> n >> a >> b;
    string s; cin >> s;

    vector<int> seg;

    int cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '*') {
            if (cur != 0) seg.push_back(cur);
            cur = 0;
        } else ++cur;
    }
    if (cur != 0) seg.push_back(cur);
    sort(seg.begin(), seg.end());
    reverse(seg.begin(), seg.end());
    int ans = 0;
    for (int i : seg) {
        if (a < b) swap(a, b);
        if (i/2 <= b) {
            ans += i/2;
            b -= i/2;
            ans += min(a, (i+1)/2);
            a -= min(a, (i+1)/2);
        } else {
            ans += min({a, b+1, (i+1)/2});
            int db = min({b, i -min({a, b+1, (i+1)/2}) });
            ans += db;
            a -= min({a, b+1, (i+1)/2});
            b -= db;
        }
    }
    cout << ans << endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b,total=0,x,y;
    cin>>n>>a>>b;
    total=a+b;
    string str;
    cin>>str;
    for(int i=0;i<str.length();i++){
        if(a==0 && b==0)break;
        x=max(a,b),y=min(a,b);
        for(int j=i,cn=0;j<str.length();cn++,j++){
            if(str[j]=='*'){
                i=j;
                break;
            }
            if(cn%2==0 && x!=0){
                x--;
                a--;
            }
            else if(y!=0 && cn%2!=0){
                y--;
                b--;
            }

        }
    }
    cout<<total-(x+y);
}