410068: GYM103937 C Robot Inspection

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Robot Inspectiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

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?

Input

The 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).

Output

The 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.

ExamplesInput
2
6 28
Output
2
Input
3
496 100 499
Output
1

加入题单

上一题 下一题 算法标签: