#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int s[N];
int main() {
  int n, a, b, x, y, ans;
  while (~scanf("%d%d%d", &n, &a, &b)) {
    x = y = ans = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &s[i]);
      if (s[i] == 1) {
        if (x == a) {
          ans++;
        } else
          x++;
      } else {
        if (y == b) {
          if (x == a) {
            ans++;
          } else
            x++;
        } else
          y++;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
