import java.util.*; import java.util.stream.IntStream; public class No316 { static boolean isMultiple(int currentInt, List numbers) { return numbers.stream().anyMatch(i -> currentInt % i == 0); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int maximumNumber = sc.nextInt(); List targetNumbers = new ArrayList<>(); while (sc.hasNextInt()) { targetNumbers.add(sc.nextInt()); } long count = IntStream.rangeClosed(1, maximumNumber) .filter(i -> isMultiple(i, targetNumbers)) .count(); System.out.println(count); } }