#import <stdio.h>
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main() {
    int x = 0, y = 0, z = 0, n, a, b;
    scanf("%d %d %d", &n, &a, &b);
    rep(i, n) {
        int p;
        scanf("%d", &p);
        if (p <= a)
            x++;
        else if (p <= b)
            y++;
        else
            z++;
    }
    printf("%d\n", MIN(MIN(x, y), z));
}
