P15890 [HackerEarth] My dear friend Durgesh loves math very much. He likes to challenge himself with different maths puzzle. Unlike many of us he has maths problem coming in his dreams! One night he dreamed
普及-
题目描述

My dear friend Durgesh loves math very much. He likes to challenge himself with different maths puzzle. Unlike many of us he has maths problem coming in his dreams! One night he dreamed of the following problem.
Given a set of binary strings and number of zeros and ones. Find out maximum number of strings that can created from the given set using given zeros and ones. You can only use one '0' or '1' once only. It is not necessary that you use all the zeros and ones given.
As he is very lazy he has asked you to solve this problem for him.

Input:

First line contain N, number of strings in the set.
N lines follows, each consist of string (of '0' and '1' ).
Last line contain two integers denoting number of ones and zeros respectively.

Output:

One line containing the required output.

Constraint:

0 < N < 18

0 < Number of zeros ≤ 500

0 < Number of ones ≤ 500

SAMPLE INPUT
4
00
11
01
10
2 4

SAMPLE OUTPUT
3

输入格式

见题面

输出格式

见题面

样例输入
6 110111110000000101011011011001010100010010010001011000000110111111111010111001001111110110100111000001110101001110000111010001011101110000000000010111110110101010100011011110101101001111001010001001010010011011100100000010111111100100111110101001101110111100011101100001100111000100001010110011010010110010010110000100001000011011011010100000111001011101110001011010011100101111001010011111100100100101101100100001010001000011111101011100011001110100111101100111011011 01010011011 001000101110100001111110000011110101010110001100101010001110101010 110011101000001101010000000110011111001000000101011000000111001100010110101101000011001110101001110110001101001001011100101000011001000001010000011010110101110010001010011100011110000110110100011101000101011100111010000010001001000000111101111100111010010100110001101100000110110011111100101100011011111110001000011111001111010101110001111110010100100110111 0010100000110010110101100000001101000010111101111000001101011001010011110010000010101100111001010011111001110101001010010011110001111011101110110101011101001011011110111100011011111011110010101010110010111010010111111010000001110101010010100101010111000001001111001011111101100000000011001101010000111011111011100111101110100000110101101110101001110101110101110001010101111011101100010110101010010010101000011010110000001111 100111010000000111110110101011111101000100111100101000011011111011010011110111101011000000111001001110011011000011010111000100110100000101111101000111101001011100011001110101110101111011011010010001111010100001100100110011000110111000110011000001110011001100000111100010010001101101110000001001110011101110010001001101000011011011010010101111000001000011000010010011001001101001011110110110101010011111 98 119
样例输出
3