#include <bits/stdc++.h>
int main() {
  int n, bowls, plates, dish, j, flag = 0, count = 0;
  scanf("%d%d%d", &n, &bowls, &plates);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &dish);
    if (dish == 1) {
      if (bowls >= 1)
        bowls--;
      else {
        count++;
      }
    } else if (dish == 2) {
      if (plates >= 1)
        plates--;
      else if (plates == 0 && bowls >= 1)
        bowls--;
      else {
        j = i;
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1)
    printf("%d ", count + n - j + 1);
  else
    printf("%d", count);
}
