410075: GYM103938 C Robot Inspection
Description
Karl is the chief of meat at the local eclair factory. Each day he arrives at the factory (next door to his house) and pulls out his trusty telescope to ensure the quality of every eclair in the Food Machine$$$^{\text{TM}}$$$. Using his telescope, he measures the weight of each eclair (it obviously has a built-in scale) and checks for anomalies. An anomaly is present if the weight of an eclair is exactly equal to the sum of its proper divisors (a proper divisor is a positive integer less than the weight which divides the weight). In that case, Karl will declare the eclair a robot and have it taken away for further inspection. Given a list of eclair weights, can you utilize Karl's telescope to find out which of them are actually robots in disguise?
InputThe input will begin with a line containing a single integer, $$$n\ (1 \leq n \leq 10^4)$$$, the number of eclairs that Karl must inspect. The next line will consist of $$$n$$$ space-separated integers, the $$$i$$$th of which denotes the weight, $$$w_i\ (1 \leq w_i \leq 500)$$$, of the $$$i$$$th eclair (or robot in disguise).
OutputThe output should consist of a single integer, the number of eclairs which are detected as anomalies by Karl's telescope, also known as the number of eclairs which are actually robots in disguise.
ExamplesInput2 6 28Output
2Input
3 496 100 499Output
1