408515: GYM103176 H Hacking
Description
The Largest Security Professional Challenge (LSPC) is a team contest. Each team consists of 3 hackers, and team shall hack as many websites as possible in 4 hours.
This year, LSPC's problemset consists of three websites to be hacked, each of different hacking difficulties. The hacking difficulties of the three websites can be represented as integers: $$$d_1$$$, $$$d_2$$$ and $$$d_3$$$, where $$$d_1 < d_2 < d_3$$$. This means that website $$$1$$$ is the easiest to hack, with difficulty of $$$d_1$$$, followed by website $$$2$$$ with difficulty $$$d_2$$$. Website $$$3$$$ is the hardest to hack, with difficulty of $$$d_3$$$.
The team from Hackerland consists of three members: Alice, Bob and Charles, each of different hacking skills. The hacking skills of the three members can also be represented as integers: $$$s_A$$$, $$$s_B$$$ and $$$s_C$$$, where $$$s_A < s_B < s_C$$$. This means that Alice with skill level $$$s_A$$$ is the weakest hacker in the team, followed by Bob with skill level $$$s_B$$$. Charles, as the best hacker in the team, has skill level $$$s_C$$$.
A Hacker $$$i$$$ is skillful enough to hack website $$$j$$$ if and only if the hacker's skill level is strictly greater than the hacking difficulty of the website, i.e. $$$s_i > d_j$$$.
As the contest time is limited, each hacker can hack NO MORE THAN ONE website during the whole contest time.
Given the hacking difficulties of the three websites, and the skill levels of the three hackers, what is the maximum number of websites that can be hacked?
InputThe first line consists of three integers $$$d_1, d_2, d_3$$$ ($$$1\le d_1 < d_2 < d_3\le 100$$$).
The second line consists of three integers $$$s_A, s_B, s_C$$$ ($$$1\le s_A < s_B < s_C\le 100$$$).
OutputA single integer, indicating the maximum number of websites that can be hacked by the team from Hackerland.
ExamplesInput10 30 50 20 45 100Output
3Input
56 78 90 12 34 56Output
0Input
31 41 59 26 53 58Output
2Input
2 71 82 8 18 28Output
1Input
12 22 32 1 10 100Output
1Note
Notice that in Sample 5, although Charles is skillful enough to hack any of the websites, he can only hack one of them during the whole contest time.