문제
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
입력
The first line contains
The second line contains
출력
The maximum
예제1
4 4 1
1 100 1 1
3
In this example, Bessie may write up to
예제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