{"task": {"agent_timeout": 600, "task": "835", "verifier_timeout": 7200, "instruction": "Please implement a Python 3 solution to the below problem.\nReason through the problem and:\n1. Restate the problem in plain English\n2. Conceptualize a solution first in plain English\n3. Write a pseudocode solution\n4. Save your solution as solution.py\nNo outside libraries are allowed.\n\n[BEGIN PROBLEM]\nIt's a hot summer day out on the farm, and Farmer John is serving lemonade to\nhis $N$ cows! All $N$ cows (conveniently numbered $1 \\dots N$) like lemonade,\nbut some of them like it more than others. In particular, cow $i$ is willing to\nwait in a line behind at most $w_i$ cows to get her lemonade. Right now all $N$\ncows are in the fields, but as soon as Farmer John rings his cowbell, the cows\nwill immediately descend upon FJ's lemonade stand. They will all arrive before\nhe starts serving lemonade, but no two cows will arrive at the same time.\nFurthermore, when cow $i$ arrives, she will join the line if and only if there\nare at most $w_i$ cows already in line.\n\nFarmer John wants to prepare some amount of lemonade in advance, but he does not\nwant to be wasteful. The number of cows who join the line might depend on the\norder in which they arrive. Help him find the minimum possible number of cows\nwho join the line.\n\nINPUT FORMAT:\nThe first line contains $N$, and the second line contains the $N$\nspace-separated integers $w_1, w_2, \\dots, w_N$.  It is guaranteed that\n$1 \\leq N \\leq 10^5$, and that $0 \\leq w_i \\leq 10^9$ for each cow $i$.\n\nOUTPUT FORMAT:\nPrint the minimum possible number of cows who might join the line, among all\npossible orders in which the cows might arrive.\n\nSAMPLE INPUT:\n5\n7 1 400 2 2\nSAMPLE OUTPUT: \n3\n\nIn this setting, only three cows might end up in line (and this is the smallest\npossible).  Suppose the cows with $w = 7$ and $w = 400$ arrive first and wait in\nline.  Then the cow with $w = 1$ arrives and turns away, since 2 cows are already\nin line.  The cows with $w = 2$ then arrive, one staying and one turning away.\n\nProblem credits: Dhruv Rohatgi\n\n[END PROBLEM]\n", "memory": "2048m", "runnable": false, "difficulty": "medium", "language": "", "cpus": 1, "instruction_truncated": false, "category": "python_programming", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "usaco", "tags": ["python", "programming", "usaco"]}, "runs": []}