public static void main ( String args [ ] ) {
  Scanner in ;
  PrintStream out ;
  try {
    in = new Scanner ( new FileInputStream ( "java.in" ) ) ;
    out = new PrintStream ( "java.out" ) ;
  }
  catch ( FileNotFoundException e ) {
    in = new Scanner ( new BufferedInputStream ( System . in ) ) ;
    out = System . out ;
  }
  int n , a , b ;
  n = in . nextInt ( ) ;
  a = in . nextInt ( ) ;
  b = in . nextInt ( ) ;
  String s = in . next ( ) ;
  int ans = 0 , pre = - 1 ;
  for ( int i = 0 ;
  i < n && ( a > 0 || b > 0 ) ;
  i ++ ) {
    if ( s . charAt ( i ) != '*' ) {
      if ( pre != - 1 ) {
        if ( pre == 0 ) {
          if ( b > 0 ) {
            b -- ;
            ans ++ ;
            pre = 1 ;
          }
          else {
            pre = - 1 ;
          }
        }
        else {
          if ( a > 0 ) {
            a -- ;
            ans ++ ;
            pre = 0 ;
          }
          else {
            pre = - 1 ;
          }
        }
      }
      else {
        if ( a > b ) {
          pre = 0 ;
          a -- ;
          ans ++ ;
        }
        else {
          pre = 1 ;
          b -- ;
          ans ++ ;
        }
      }
    }
    else pre = - 1 ;
  }
  out . println ( ans ) ;
}

public static void main ( String args [ ] ) { Scanner in ; PrintStream out ; try { in = new Scanner ( new FileInputStream ( " java . in " ) ) ; out = new PrintStream ( " java . out " ) ; } catch ( FileNotFoundException e ) { in = new Scanner ( new BufferedInputStream ( System . in ) ) ; out = System . out ; } int n , a , b ; n = in . nextInt ( ) ; a = in . nextInt ( ) ; b = in . nextInt ( ) ; String s = in . next ( ) ; int ans = 0 , pre = - 1 ; for ( int i = 0 ; i < n && ( a > 0 || b > 0 ) ; i ++ ) { if ( s . charAt ( i ) != ' * ' ) { if ( pre != - 1 ) { if ( pre == 0 ) { if ( b > 0 ) { b -- ; ans ++ ; pre = 1 ; } else { pre = - 1 ; } } else { if ( a > 0 ) { a -- ; ans ++ ; pre = 0 ; } else { pre = - 1 ; } } } else { if ( a > b ) { pre = 0 ; a -- ; ans ++ ; } else { pre = 1 ; b -- ; ans ++ ; } } } else pre = - 1 ; } out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (try_statement body: (block (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal)))))) (catch_clause (catch_formal_parameter (catch_type (type_identifier)) name: (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal))))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal))))))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier)))))))) alternative: (expression_statement (assignment_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))