A group of children are handed out cookies. Child i has a greed factor greed[i], and a child becomes content only when handed a single cookie whose size is at least that child's greed factor. There are some cookies available, cookie j having size sizes[j]. Each cookie can be given to at most one child, and each child may receive at most one cookie.
Distribute the cookies so that the number of content children is as large as possible, and print that maximum number.
Input format
Line 1: an integer g, the number of children.
Line 2: g space-separated integers, the greed factors (this line is empty when g = 0).
Line 3: an integer s, the number of cookies.
Line 4: s space-separated integers, the cookie sizes (this line is empty when s = 0).
Output format
A single integer: the maximum number of children that can be made content.
Constraints
- 0 <= g <= 100000
- 0 <= s <= 100000
- 1 <= greed[i] <= 1000000000
- 1 <= sizes[j] <= 1000000000