#include <bits/stdc++.h>
using namespace std;
long long Gcd(long long a, long long b) { return !b ? a : Gcd(b, a % b); }
void dance() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool isprime(long long n) {
  if (n < 2)
    return false;
  else if (n == 2)
    return true;
  else if (n % 2 == 0)
    return false;
  for (long long i = 3; i <= sqrt(n); i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}
int o, t;
int solve(string s, int pos, char prev = '*') {
  if (pos == s.length()) return 0;
  if (s[pos] == '.') {
    int a = 0, b = 0;
    if (prev != '1' && o > 0) {
      s[pos] == '1';
      o--;
      a = solve(s, pos + 1, '1') + 1;
    }
    if (prev != '2' && t > 0) {
      s[pos] == '2';
      t--;
      b = solve(s, pos + 1, '2') + 1;
    }
    if (a > b) {
      t++;
      return a;
    } else {
      o++;
      return b;
    }
  } else
    return solve(s, pos + 1, '*');
}
int main() {
  dance();
  string s;
  int n, a, b;
  cin >> n >> a >> b;
  cin >> s;
  if (a > b) swap(a, b);
  int c = 0, f = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '.' && b >= a) {
      if (s[i - 1] != 'b' && b > 0) {
        s[i] = 'b';
        if (b > 0) c++;
        b--;
      } else if (s[i - 1] != 'a' && a > 0) {
        s[i] = 'a';
        if (a > 0) c++;
        a--;
      }
    } else if (s[i] == '.') {
      if (s[i - 1] != 'a' && a > 0) {
        s[i] = 'a';
        if (a > 0) c++;
        a--;
      } else if (s[i - 1] != 'b' && b > 0) {
        s[i] = 'b';
        if (b > 0) c++;
        b--;
      }
    }
  }
  cout << c << endl;
  return 0;
}
