Problems
Bessie the cow has enrolled in a computer science PhD program, driven by her love of computer science and also the allure of one day becoming "Dr. Bessie". Having worked for some time on her academic research, she has now published N
papers
Bessie has heard that an academic's success can be measured by their
To up her
Help Bessie determine the maximum
Note that Bessie's research advisor should probably inform her at some point that writing a survey solely to increase one's
Input
The first line contains
The second line contains
Output
The maximum
Example #1
4 4 1
1 100 1 1
3
In this example, Bessie may write up to
Example #2
4 1 4
1 100 1 1
2
In this second example, Bessie may write at most a single article. If Bessie cites any of her first, third, or fourth papers at least once, her