Ensure that you are logged in and have the required permissions to access the test.

Killjee and unique numbers

5

1 votes
Medium
Problem

Killjee has a list of 12 numbers and he wants to find how many unique numbers are there which are N. A number is said to be unque if it is divisible by any of number in Killjee's list.

INPUT CONSTRAINTS

  • 1N1018
  • 1 number in killjee's list 30

INPUT FORMAT

First line of input contains a single integer N, second line contains 12 space separated integers, number of Killjee's list.

OUTPUT FORMAT

Print answer to the problem.

Sample Input
100
2 3 4 5 6 7 8 9 10 11 12 13
Sample Output
80
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

80 numbers are <=100 and is divisible by any of 12 numbers.

Editor Image

?