#include <bits/stdc++.h>
using namespace std;
int choose_tools(int &bowl_last, int &plate_last, int dish) {
  if (dish == 1) {
    bowl_last = bowl_last - 1;
  }
  if (dish == 2) {
    if (plate_last > 0) {
      plate_last = plate_last - 1;
    } else {
      bowl_last = bowl_last - 1;
    }
  }
  if (bowl_last < 0)
    return -1;
  else if (plate_last < 0)
    return -2;
  else
    return 0;
}
int main() {
  int n;
  int m;
  int k;
  int dish[1001];
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> dish[i];
  int bowl_last = m;
  int plate_last = k;
  int result = 0;
  int day = 0;
  while (day < n) {
    int eat_result = choose_tools(bowl_last, plate_last, dish[day]);
    switch (eat_result) {
      case 0:
        break;
      case -1:
        bowl_last = bowl_last + 1;
        result = result + 1;
        break;
      case -2:
        plate_last = plate_last + 1;
        result = result + 1;
        break;
      default:
        break;
    }
    day = day + 1;
  }
  cout << result;
}
